From e6c1e8b9f989b9044cd07ed09930e5efe63bcbcb Mon Sep 17 00:00:00 2001 From: millert <> Date: Tue, 2 Jan 2001 18:22:32 +0000 Subject: [PATCH] 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)). --- src/lib/libutil/passwd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/libutil/passwd.c b/src/lib/libutil/passwd.c index f1b37e08..8b98890a 100644 --- a/src/lib/libutil/passwd.c +++ b/src/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 @@ -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();