From: Roy Marples Date: Fri, 7 Jun 2019 16:15:00 +0000 (+0100) Subject: Fix a gcc warning about signed overflow X-Git-Tag: v8.0.0~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4bbe0ae2c7ba4f4ba8cc86d3e3105caa4220186;p=thirdparty%2Fdhcpcd.git Fix a gcc warning about signed overflow --- diff --git a/src/dhcp.c b/src/dhcp.c index 23770073..25a9e72c 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -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; } diff --git a/src/ipv4.c b/src/ipv4.c index 0cf5597f..5f138b5c 100644 --- a/src/ipv4.c +++ b/src/ipv4.c @@ -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;