diff options
author | 2001-01-02 18:22:32 +0000 | |
---|---|---|
committer | 2001-01-02 18:22:32 +0000 | |
commit | 59c6398f8ef7ee6b53956043d72241a6b6a27711 (patch) | |
tree | 013fc238973ae3216aa3548830d708b5178b53e3 /lib/libutil | |
parent | accumulate memory total requests in quad (diff) | |
download | wireguard-openbsd-59c6398f8ef7ee6b53956043d72241a6b6a27711.tar.xz wireguard-openbsd-59c6398f8ef7ee6b53956043d72241a6b6a27711.zip |
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')
-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(); |