]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix a gcc warning about signed overflow
authorRoy Marples <roy@marples.name>
Fri, 7 Jun 2019 16:15:00 +0000 (17:15 +0100)
committerRoy Marples <roy@marples.name>
Fri, 7 Jun 2019 16:15:00 +0000 (17:15 +0100)
src/dhcp.c
src/ipv4.c

index 23770073777cae4026200bdbf949bf759fb00e39..25a9e72cd9c94601f306164c40ff3688b858be37 100644 (file)
@@ -469,7 +469,7 @@ decode_rfc3442_rt(rb_tree_t *routes, struct interface *ifp,
                sa_in_init(&rt->rt_netmask, &netmask);
                sa_in_init(&rt->rt_gateway, &gateway);
                if (rt_proto_add(routes, rt))
-                       n++;
+                       n = 1;
        }
        return n;
 }
index 0cf5597f75b3009e5e83d6b1c5d8e6675b21cce4..5f138b5c9af10337cd6d1baf566ef5dab0902ab7 100644 (file)
@@ -333,7 +333,7 @@ inet_dhcproutes(rb_tree_t *routes, struct interface *ifp, bool *have_default)
                }
                if (rt_is_default(rt))
                        *have_default = true;
-               n++;
+               n = 1;
        }
 
        return n;