From 666ad997d8c7d1bf815318f5a4eefa809c49f0d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Charl=C3=A8ne=20Wendling?= Date: Sat, 10 Oct 2020 22:29:53 +0200 Subject: [PATCH] Properly read the config files on unsigned char archs Allow to properly read the configuration files on archs where char is unsigned (arm, ppc), as EOF is usually -1. --- src/config_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config_file.c b/src/config_file.c index 0089ef6..ac8fe9a 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -78,7 +78,7 @@ static token_t next_token(FILE *f, strbuf_t* sbuf, int *lineno, jmp_buf *escape) bool skip_to_eol = false; bool in_quotes = false; for (;;) { - char next = fgetc(f); + int next = fgetc(f); if (EOF == next) return (has_chars(sbuf) && !skip_to_eol) ? tTOKEN : tEOF; else if ('\n' == next) { -- 2.39.2