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]>
--- 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;
}