From 3bd678d48e333045352b89ff06557d6c660a799a Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Sun, 4 Oct 2020 23:21:03 +0200 Subject: [PATCH] case EOF is now checked only on x86 arches This check causes problems on architectures where char is unsigned, thus EOF which is a signed int has a value less of the minimum permitted by the type. To be honest this check could just be avoided alltogether, maybe in the future. --- hkd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hkd.c b/hkd.c index d4ddee6..927a495 100644 --- a/hkd.c +++ b/hkd.c @@ -753,7 +753,9 @@ void parse_config_file (void) bb++; // get state switch (*bb) { - case (int)EOF: +#if defined(__X86_64__) || defined(__i386__) + case EOF: +#endif case '\0': // If it is the end of the last block exit if (exit_state > 1)