summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Kozhukhov <ikozhukhov@gmail.com>2013-08-13 09:02:40 -0700
committerRobert Mustacchi <rm@joyent.com>2013-08-13 17:16:11 -0700
commit559372b3a1f0f2d0da204a93e42942065acd4530 (patch)
tree48b57ad1607503e93cbca7593ad1cdfaa3881bb3
parent0f36b8433e9a3e3d3803c54bad5be5de92aec546 (diff)
downloadillumos-joyent-559372b3a1f0f2d0da204a93e42942065acd4530.tar.gz
4026 cleanup warnings in cmd/passwd
Reviewed by: Jason King <jason.brian.king@gmail.com> Reviewed by: Cedric Blancher <cedric.blancher@gmail.com> Reviewed by: Keith Wesolowski <keith.wesolowski@joyent.com> Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/cmd/passwd/Makefile4
-rw-r--r--usr/src/cmd/passwd/passwd.c8
2 files changed, 5 insertions, 7 deletions
diff --git a/usr/src/cmd/passwd/Makefile b/usr/src/cmd/passwd/Makefile
index d53cad2cd6..561357a16c 100644
--- a/usr/src/cmd/passwd/Makefile
+++ b/usr/src/cmd/passwd/Makefile
@@ -33,10 +33,6 @@ lint := LDLIBS += -lpasswdutil
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
diff --git a/usr/src/cmd/passwd/passwd.c b/usr/src/cmd/passwd/passwd.c
index 851de6f237..7d993f681b 100644
--- a/usr/src/cmd/passwd/passwd.c
+++ b/usr/src/cmd/passwd/passwd.c
@@ -236,7 +236,7 @@ main(int argc, char *argv[])
int updated_reps;
- if (prognamep = strrchr(argv[0], '/'))
+ if ((prognamep = strrchr(argv[0], '/')) != NULL)
++prognamep;
else
prognamep = argv[0];
@@ -1240,10 +1240,10 @@ get_attr(char *username, pwu_repository_t *repository, attrlist **attributes)
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 @@ display_attr(char *usrname, attrlist *attributes)
case ATTR_WARN:
warn = attributes->data.val_i;
break;
+ default:
+ break;
}
attributes = attributes->next;
}