Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jan 2010 10:14:35 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r201385 - in head/usr.bin: passwd sockstat
Message-ID:  <201001021014.o02AEZL1009684@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sat Jan  2 10:14:35 2010
New Revision: 201385
URL: http://svn.freebsd.org/changeset/base/201385

Log:
  Mute some warnings on uninitialized variables.
  
  The code does the right thing, but the compiler is unable to figure it
  out. All paths that use that variable use the same invariant.

Modified:
  head/usr.bin/passwd/passwd.c
  head/usr.bin/sockstat/sockstat.c

Modified: head/usr.bin/passwd/passwd.c
==============================================================================
--- head/usr.bin/passwd/passwd.c	Sat Jan  2 10:13:21 2010	(r201384)
+++ head/usr.bin/passwd/passwd.c	Sat Jan  2 10:14:35 2010	(r201385)
@@ -67,7 +67,7 @@ int
 main(int argc, char *argv[])
 {
 	char hostname[MAXHOSTNAMELEN];
-	struct passwd *pwd;
+	struct passwd *pwd = NULL; /* Keep compiler happy. */
 	int o, pam_err;
 	uid_t uid;
 

Modified: head/usr.bin/sockstat/sockstat.c
==============================================================================
--- head/usr.bin/sockstat/sockstat.c	Sat Jan  2 10:13:21 2010	(r201384)
+++ head/usr.bin/sockstat/sockstat.c	Sat Jan  2 10:14:35 2010	(r201385)
@@ -496,8 +496,8 @@ printaddr(int af, struct sockaddr_storag
 {
 	char addrstr[INET6_ADDRSTRLEN] = { '\0', '\0' };
 	struct sockaddr_un *sun;
-	void *addr;
-	int off, port;
+	void *addr = NULL; /* Keep compiler happy. */
+	int off, port = 0;
 
 	switch (af) {
 	case AF_INET:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001021014.o02AEZL1009684>