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:
Philip Withnall 2025-03-04 12:45:01 +00:00
parent 4d566e47d7
commit 3920e0f172
No known key found for this signature in database
GPG Key ID: C5C42CFB268637CA

View File

@ -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);