Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/netstat Don't use uninitialized variable.



details:   https://anonhg.NetBSD.org/src/rev/b2adaf5d8c1e
branches:  trunk
changeset: 543549:b2adaf5d8c1e
user:      enami <enami%NetBSD.org@localhost>
date:      Thu Feb 27 08:07:14 2003 +0000

description:
Don't use uninitialized variable.

diffstat:

 usr.bin/netstat/mbuf.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 33f1e9f092c1 -r b2adaf5d8c1e usr.bin/netstat/mbuf.c
--- a/usr.bin/netstat/mbuf.c    Thu Feb 27 07:50:57 2003 +0000
+++ b/usr.bin/netstat/mbuf.c    Thu Feb 27 08:07:14 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbuf.c,v 1.19 2003/02/26 06:31:21 matt Exp $   */
+/*     $NetBSD: mbuf.c,v 1.20 2003/02/27 08:07:14 enami Exp $  */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "from: @(#)mbuf.c       8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: mbuf.c,v 1.19 2003/02/26 06:31:21 matt Exp $");
+__RCSID("$NetBSD: mbuf.c,v 1.20 2003/02/27 08:07:14 enami Exp $");
 #endif
 #endif /* not lint */
 
@@ -227,7 +227,8 @@
                return;
        }
 
-       for (mo = (void *) data; len >= sizeof(*mo); len -= sizeof(*mo), mo++) {
+       for (mo = (void *) data, lines = 0; len >= sizeof(*mo);
+           len -= sizeof(*mo), mo++) {
                char buf[32];
                if (vflag == 1 &&
                    mo->mo_claims == 0 &&



Home | Main Index | Thread Index | Old Index