]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: dev/flags: remove useless test in the stdin number parser
authorWilly Tarreau <w@1wt.eu>
Sat, 3 Apr 2021 13:26:56 +0000 (15:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 3 Apr 2021 13:29:10 +0000 (15:29 +0200)
The test on "if (err)" after parsing a number was meant to be
"if (*err)" but in practise it will always be true since we at least
have a '\n' there, so no need for testing before writing zero.
This fixes issue #1211.

dev/flags/flags.c

index 669bd090c9c9585a7c081138cc1c97c999fbe22e..ccd22050d87f18b9085ff0dfb358f4b9fddbfaee 100644 (file)
@@ -441,8 +441,7 @@ int main(int argc, char **argv)
                        while (*err == '-' || *err == '+' ||
                               (isalnum((unsigned char)*err) && toupper((unsigned char)*err) != 'U' && toupper((unsigned char)*err) != 'L'))
                                err++;
-                       if (err)
-                               *err = 0;
+                       *err = 0;
                } else {
                        value = argv[0];
                        argv++; argc--;