mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-26 22:12:16 +01:00
tests/unix: Ensure buffer is NUL terminated
This commit is contained in:
committed by
Matthias Clasen
parent
6fe87988d1
commit
2143e799f4
@@ -43,6 +43,7 @@ test_pipe (void)
|
|||||||
memset (buf, 0, sizeof (buf));
|
memset (buf, 0, sizeof (buf));
|
||||||
bytes_read = read (pipefd[0], buf, sizeof(buf) - 1);
|
bytes_read = read (pipefd[0], buf, sizeof(buf) - 1);
|
||||||
g_assert_cmpint (bytes_read, >, 0);
|
g_assert_cmpint (bytes_read, >, 0);
|
||||||
|
buf[bytes_read] = '\0';
|
||||||
|
|
||||||
close (pipefd[0]);
|
close (pipefd[0]);
|
||||||
close (pipefd[1]);
|
close (pipefd[1]);
|
||||||
|
|||||||
Reference in New Issue
Block a user