From 50f091ab7ced12e76f458a7a55e961839b5c1e80 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sat, 18 Jan 2020 22:12:25 +0100 Subject: [PATCH] Fix RGBLINK failing to read args on certain machines `char` has implementation-defined signedness, and if it's chosen to be unsigned, then -1 gets converted to 255, which is then promoted back to `int` as... 255, always failing the loop condition in src/link/main.c:118 `int8_t` has the correct signedness, but considering `musl_getopt_long_only` returns `int`, better use that so as not to lose any bits --- src/link/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/link/main.c b/src/link/main.c index e849aec8..d08aee9e 100644 --- a/src/link/main.c +++ b/src/link/main.c @@ -109,7 +109,7 @@ static void cleanup(void) int main(int argc, char *argv[]) { - char optionChar; + int optionChar; char *endptr; /* For error checking with `strtol` */ unsigned long value; /* For storing `strtoul`'s return value */