]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix a bogus gcc warning about a potential signed overflow.
authorRoy Marples <roy@marples.name>
Mon, 21 Dec 2015 11:07:32 +0000 (11:07 +0000)
committerRoy Marples <roy@marples.name>
Mon, 21 Dec 2015 11:07:32 +0000 (11:07 +0000)
dhcpcd.c

index 6ba4ace9bac44fbc69192a0edc49e44a5018dbdc..529188ad8f7fac36a7ea880c613e1a449998f0f5 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1693,8 +1693,11 @@ main(int argc, char **argv)
        }
 
 #ifdef USE_SIGNALS
-       if (!(ctx.options & DHCPCD_TEST) &&
-           (sig == 0 || i == 4 || ctx.ifc != 0))
+       /* Test against siga instead of sig to avoid gcc
+        * warning about a bogus potential signed overflow.
+        * The end result will be the same. */
+       if ((siga == NULL || i == 4 || ctx.ifc != 0) &&
+           !(ctx.options & DHCPCD_TEST))
        {
 #endif
                if (ctx.options & DHCPCD_MASTER)