4026 cleanup warnings in cmd/passwd
authorIgor Kozhukhov <ikozhukhov@gmail.com>
Tue, 13 Aug 2013 09:02:40 -0700
changeset 14219 9178198c46b5
parent 14218 62094c23dbe2
child 14220 f7523d207d74
4026 cleanup warnings in cmd/passwd Reviewed by: Jason King <[email protected]> Reviewed by: Cedric Blancher <[email protected]> Reviewed by: Keith Wesolowski <[email protected]> Approved by: Robert Mustacchi <[email protected]>
usr/src/cmd/passwd/Makefile
usr/src/cmd/passwd/passwd.c
--- a/usr/src/cmd/passwd/Makefile	Tue Aug 13 09:50:44 2013 -0400
+++ b/usr/src/cmd/passwd/Makefile	Tue Aug 13 09:02:40 2013 -0700
@@ -33,10 +33,6 @@
 LDFLAGS += $(ZIGNORE)
 LDLIBS += -lbsm -lpam -lnsl
 
-CERRWARN += -_gcc=-Wno-switch
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-uninitialized
-
 FILEMODE = 06555
 XGETFLAGS += -a -x $(PROG).xcl
 
--- a/usr/src/cmd/passwd/passwd.c	Tue Aug 13 09:50:44 2013 -0400
+++ b/usr/src/cmd/passwd/passwd.c	Tue Aug 13 09:02:40 2013 -0700
@@ -236,7 +236,7 @@
 	int	updated_reps;
 
 
-	if (prognamep = strrchr(argv[0], '/'))
+	if ((prognamep = strrchr(argv[0], '/')) != NULL)
 		++prognamep;
 	else
 		prognamep = argv[0];
@@ -1240,10 +1240,10 @@
 void
 display_attr(char *usrname, attrlist *attributes)
 {
-	char	*status;
+	char	*status = NULL;
 	char	*passwd;
 	long	lstchg;
-	int	min, max, warn;
+	int	min = 0, max = 0, warn = 0;
 
 	while (attributes) {
 		switch (attributes->type) {
@@ -1275,6 +1275,8 @@
 		case ATTR_WARN:
 			warn = attributes->data.val_i;
 			break;
+		default:
+			break;
 		}
 		attributes = attributes->next;
 	}