Module Name:    src
Committed By:   riastradh
Date:           Wed Jan 27 18:55:51 UTC 2016

Modified Files:
        src/usr.sbin/ifwatchd: ifwatchd.c

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

Signed shift into sign bit and beyond is undefined behaviour.

>From Michael McConville.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/ifwatchd/ifwatchd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/ifwatchd/ifwatchd.c
diff -u src/usr.sbin/ifwatchd/ifwatchd.c:1.26 src/usr.sbin/ifwatchd/ifwatchd.c:1.27
--- src/usr.sbin/ifwatchd/ifwatchd.c:1.26	Tue Aug 30 18:57:38 2011
+++ src/usr.sbin/ifwatchd/ifwatchd.c	Wed Jan 27 18:55:51 2016
@@ -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 @@ check_addrs(char *cp, int addrs, enum ev
 	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;

Reply via email to