summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat/netstat.c
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2006-11-27 17:34:40 +0000
committeryar <yar@FreeBSD.org>2006-11-27 17:34:40 +0000
commit0ceaba73fc1ee61fbde03d631b1ed00d2fdb89ba (patch)
treee74cfe11b85b03775a107045c25bf4ba273fd755 /usr.bin/systat/netstat.c
parentcf3ea4f2b87ee8ddcfb809cf0423d7619a9dd024 (diff)
downloadFreeBSD-src-0ceaba73fc1ee61fbde03d631b1ed00d2fdb89ba.zip
FreeBSD-src-0ceaba73fc1ee61fbde03d631b1ed00d2fdb89ba.tar.gz
The logic of fetchnetstat_sysctl() isn't too complex: if idx is 0,
we set and use xtp; if idx is 1, we set and use xip; the other cases are impossible. However, GCC cannot see that xip and xtp are always initialized before use because they are initialized and used in different if/else blocks. So setting them to NULL at the very beginning won't hurt.
Diffstat (limited to 'usr.bin/systat/netstat.c')
-rw-r--r--usr.bin/systat/netstat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c
index 564362e..22ef864 100644
--- a/usr.bin/systat/netstat.c
+++ b/usr.bin/systat/netstat.c
@@ -252,8 +252,8 @@ fetchnetstat_sysctl()
struct xinpgen *inpg;
char *cur, *end;
struct inpcb *inpcb;
- struct xinpcb *xip;
- struct xtcpcb *xtp;
+ struct xinpcb *xip = NULL;
+ struct xtcpcb *xtp = NULL;
int plen;
size_t lsz;
OpenPOWER on IntegriCloud