diff options
author | mmcc <mmcc@cvs.openbsd.org> | 2016-01-26 18:26:20 +0000 |
---|---|---|
committer | mmcc <mmcc@cvs.openbsd.org> | 2016-01-26 18:26:20 +0000 |
commit | 5abd416f560ecb947d32794f07d53e1d1408d3d0 (patch) | |
tree | 1974d9d201e77c570d3e577047dced7fa61ce481 /sbin/dhclient/dhclient.c | |
parent | d11e25ef62dfb6b4f7c303711ec62676b5d0a75b (diff) |
Use an unsigned int rather than an int when iterating through all 32
bits in the form:
for (i = 1; i; i <<= 1)
This avoids undefined operations when shifting into and out of the
highest-order bit.
ok millert@
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r-- | sbin/dhclient/dhclient.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 58efa743f7a..70554488677 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.370 2015/12/12 14:48:17 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.371 2016/01/26 18:26:19 mmcc Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -160,7 +160,7 @@ int findproto(char *cp, int n) { struct sockaddr *sa; - int i; + unsigned int i; if (n == 0) return -1; @@ -190,7 +190,7 @@ struct sockaddr * get_ifa(char *cp, int n) { struct sockaddr *sa; - int i; + unsigned int i; if (n == 0) return (NULL); |