mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-13 11:15:12 +01:00
tests: Fix an incorrect array length in stream-rw_all test
The array was declared one byte too short to contain the trailing nul byte for the string literal. Spotted by gcc 15. Fix it by allowing the compiler to work out the array length. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
4d566e47d7
commit
3920e0f172
@ -119,10 +119,10 @@ static void
|
|||||||
test_read_all_async_memory (void)
|
test_read_all_async_memory (void)
|
||||||
{
|
{
|
||||||
GInputStream *ms;
|
GInputStream *ms;
|
||||||
gchar b[24] = "0123456789ABCDEFGHIJ!@#$";
|
gchar b[] = "0123456789ABCDEFGHIJ!@#$";
|
||||||
gchar buf[10];
|
gchar buf[10];
|
||||||
|
|
||||||
ms = g_memory_input_stream_new_from_data (b, sizeof b, NULL);
|
ms = g_memory_input_stream_new_from_data (b, strlen (b), NULL);
|
||||||
|
|
||||||
g_input_stream_read_all_async (ms, buf, 10, 0, NULL, read_done, NULL);
|
g_input_stream_read_all_async (ms, buf, 10, 0, NULL, read_done, NULL);
|
||||||
wait_for_read (TRUE, 10);
|
wait_for_read (TRUE, 10);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user