1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-12 14:21:30 +03:00
Files
glibc/support/xstdio.h
Florian Weimer cea56af185 support: Change xgetline to return 0 on EOF
The advantage is that the buffer will always contain the number
of characters as returned from the function, which allows one to use
a sequence like

  /* No more audit module output.  */
  line_length = xgetline (&buffer, &buffer_length, fp);
  TEST_COMPARE_BLOB ("", 0, buffer, line_length);

to check for an expected EOF, while also reporting any unexpected
extra data encountered.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2020-04-03 16:26:10 +02:00

1.3 KiB