diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-02 18:22:33 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-02 18:22:33 +0000 |
commit | eb28651405695937ba5d521b02fa50754ff67c90 (patch) | |
tree | 9ca7736e6cb55e0eea2af4a948c1fb7eabc7d154 /lib/libutil/passwd.c | |
parent | f4861e3d100e171e85a758073cd4a9161db731be (diff) |
Fix a problem introduced by the printf format sweep. Passing a NULL
pw_error() is prefectly legal but now we have to check for it explicity
(it was handled implicitly before since warn(name) would become warn(NULL)).
Diffstat (limited to 'lib/libutil/passwd.c')
-rw-r--r-- | lib/libutil/passwd.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c index f1b37e08bec..8b98890a77e 100644 --- a/lib/libutil/passwd.c +++ b/lib/libutil/passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: passwd.c,v 1.23 2000/11/26 01:25:33 millert Exp $ */ +/* $OpenBSD: passwd.c,v 1.24 2001/01/02 18:22:32 millert Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: passwd.c,v 1.23 2000/11/26 01:25:33 millert Exp $"; +static char rcsid[] = "$OpenBSD: passwd.c,v 1.24 2001/01/02 18:22:32 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -588,8 +588,12 @@ pw_error(name, err, eval) { char *master = pw_file(_PATH_MASTERPASSWD); - if (err) - warn("%s", name); + if (err) { + if (name) + warn("%s", name); + else + warn(NULL); + } if (master) warnx("%s: unchanged", master); pw_abort(); |