Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/ifwatchd Use unsigned, not signed, int for shifting...



details:   https://anonhg.NetBSD.org/src/rev/c3b0511b06d7
branches:  trunk
changeset: 343280:c3b0511b06d7
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jan 27 18:55:51 2016 +0000

description:
Use unsigned, not signed, int for shifting 1 left until zero.

Signed shift into sign bit and beyond is undefined behaviour.

>From Michael McConville.

diffstat:

 usr.sbin/ifwatchd/ifwatchd.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 5de3daacf1cc -r c3b0511b06d7 usr.sbin/ifwatchd/ifwatchd.c
--- a/usr.sbin/ifwatchd/ifwatchd.c      Wed Jan 27 18:43:44 2016 +0000
+++ b/usr.sbin/ifwatchd/ifwatchd.c      Wed Jan 27 18:55:51 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ifwatchd.c,v 1.26 2011/08/30 18:57:38 joerg Exp $      */
+/*     $NetBSD: ifwatchd.c,v 1.27 2016/01/27 18:55:51 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -292,7 +292,8 @@
        struct sockaddr *sa, *ifa = NULL, *brd = NULL;
        char ifname_buf[IFNAMSIZ];
        const char *ifname;
-       int ifndx = 0, i;
+       int ifndx = 0;
+       unsigned i;
 
        if (addrs == 0)
                return;



Home | Main Index | Thread Index | Old Index