From 7d42376a3aee86f3558cb611941b31a50f7e1795 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Mon, 1 Jun 2026 22:56:23 +0100 Subject: [PATCH] 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. --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 6995ee9..029223b 100644 --- a/src/util.c +++ b/src/util.c @@ -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;