diff options
| author | David Malone <dwmalone@FreeBSD.org> | 2002-03-30 13:44:45 +0000 |
|---|---|---|
| committer | David Malone <dwmalone@FreeBSD.org> | 2002-03-30 13:44:45 +0000 |
| commit | b719e49da943cac32d2d31c602e8e34585df4605 (patch) | |
| tree | 51aa80b2fbdafa59664605b1d37b10b3941bcc2a /chpass/pw_yp.c | |
| parent | 04d1b23be991cae809ac39645d9ac7341ec74885 (diff) | |
| download | pw-darwin-b719e49da943cac32d2d31c602e8e34585df4605.tar.gz pw-darwin-b719e49da943cac32d2d31c602e8e34585df4605.zip | |
Minor post warns stuff.
1) Fix up vendor IDs for files I'm touching and put FBSDID in the right place.
2) Cast return value of snprintf to size_t rather than casting sizeof() to
an int, 'cos we know snprintf returns a non-genative number.
3) Avoid 'char *blank = "";' by just strduping. This could be bad sometimes,
but all these variables usually point at malloced memory so this makes
them always point at malloced memory.
Diffstat (limited to 'chpass/pw_yp.c')
| -rw-r--r-- | chpass/pw_yp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/chpass/pw_yp.c b/chpass/pw_yp.c index 90fa9e0..30e2f77 100644 --- a/chpass/pw_yp.c +++ b/chpass/pw_yp.c @@ -81,7 +81,6 @@ static HASHINFO openinfo = { static char passwdbyname[] = "passwd.byname"; static char localhost[] = "localhost"; -static char blank[] = ""; int force_old = 0; int _use_yp = 0; @@ -437,8 +436,8 @@ yp_submit(struct passwd *pw) master_yppasswd.newpw.pw_shell = strdup(pw->pw_shell); master_yppasswd.newpw.pw_class = pw->pw_class != NULL ? strdup(pw->pw_class) - : blank; - master_yppasswd.oldpass = blank; /* not really needed */ + : strdup(""); + master_yppasswd.oldpass = strdup(""); /* not really needed */ master_yppasswd.domain = yp_domain; } else { yppasswd.newpw.pw_passwd = strdup(pw->pw_passwd); @@ -448,7 +447,7 @@ yp_submit(struct passwd *pw) yppasswd.newpw.pw_gecos = strdup(pw->pw_gecos); yppasswd.newpw.pw_dir = strdup(pw->pw_dir); yppasswd.newpw.pw_shell = strdup(pw->pw_shell); - yppasswd.oldpass = blank; + yppasswd.oldpass = strdup(""); } /* Get the user's password for authentication purposes. */ |
