mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-29 15:01:23 +00:00
Merge branch 'michaelweghorn/a11y_report_empty_string' into 'main'
a11y: Report empty string as such See merge request GNOME/gtk!6933
This commit is contained in:
commit
4c794505da
@ -80,12 +80,13 @@ nul_terminate_contents (GBytes *bytes)
|
||||
gsize size;
|
||||
|
||||
data = g_bytes_get_data (bytes, &size);
|
||||
if (size > 0 && data[size - 1] != '\0')
|
||||
if (size == 0 || (size > 0 && data[size - 1] != '\0'))
|
||||
{
|
||||
guchar *copy;
|
||||
|
||||
copy = g_new (guchar, size + 1);
|
||||
memcpy (copy, data, size);
|
||||
if (size > 0)
|
||||
memcpy (copy, data, size);
|
||||
copy[size] = '\0';
|
||||
|
||||
g_bytes_unref (bytes);
|
||||
|
Loading…
Reference in New Issue
Block a user