Browse Source

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)).
OPENBSD_2_9
millert 24 years ago
parent
commit
e6c1e8b9f9
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      src/lib/libutil/passwd.c

+ 8
- 4
src/lib/libutil/passwd.c View File

@ -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 * Copyright (c) 1987, 1993, 1994, 1995
@ -34,7 +34,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #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 */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -588,8 +588,12 @@ pw_error(name, err, eval)
{ {
char *master = pw_file(_PATH_MASTERPASSWD); char *master = pw_file(_PATH_MASTERPASSWD);
if (err)
warn("%s", name);
if (err) {
if (name)
warn("%s", name);
else
warn(NULL);
}
if (master) if (master)
warnx("%s: unchanged", master); warnx("%s: unchanged", master);
pw_abort(); pw_abort();


Loading…
Cancel
Save