Mercurial > illumos > illumos-gate
diff usr/src/cmd/passwd/passwd.c @ 14136:9178198c46b5
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>
author | Igor Kozhukhov <ikozhukhov@gmail.com> |
---|---|
date | Tue, 13 Aug 2013 09:02:40 -0700 |
parents | f6cca4323de0 |
children |
line wrap: on
line diff
--- 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; }