Fix get_line_alloc()

Assigning the result of getc() to a char makes comparing it to EOF
unreliable, at the very least. You're never too old to make newbie
mistakes.

Thanks to Sebastian Gottschall  for spotting this.
This commit is contained in:
Simon Kelley committed 2026-06-01 22:56:23 +01:00
1 parent 08cc209e7a
commit 7d42376a3a
1 file changed
+1 -1
+1 -1
View File
@@ -1041,7 +1041,7 @@ void free_real(const char *func, unsigned int line, void *ptr)
EOF reached and we return zero. */
int get_line_alloc(FILE *f, char **buffp, size_t *sizep)
{
char c;
int c;
size_t cnt = 0;
char *buff = *buffp;