From 3babad2e4242ebffd170c924abbca43dfe20c0ab Mon Sep 17 00:00:00 2001 From: Dima Dorfman Date: Sun, 22 Apr 2001 03:00:09 +0000 Subject: [PATCH] Don't pass NULL to the %s format. Reviewed by: kris --- lib/libutil/pw_util.c | 8 ++++++-- usr.sbin/vipw/pw_util.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/libutil/pw_util.c b/lib/libutil/pw_util.c index fe99d7171b34..c6c70ffb3e99 100644 --- a/lib/libutil/pw_util.c +++ b/lib/libutil/pw_util.c @@ -249,8 +249,12 @@ pw_error(name, err, eval) #ifdef YP extern int _use_yp; #endif /* YP */ - if (err) - warn("%s", name); + if (err) { + if (name != NULL) + warn("%s", name); + else + warn(NULL); + } #ifdef YP if (_use_yp) warnx("NIS information unchanged"); diff --git a/usr.sbin/vipw/pw_util.c b/usr.sbin/vipw/pw_util.c index fe99d7171b34..c6c70ffb3e99 100644 --- a/usr.sbin/vipw/pw_util.c +++ b/usr.sbin/vipw/pw_util.c @@ -249,8 +249,12 @@ pw_error(name, err, eval) #ifdef YP extern int _use_yp; #endif /* YP */ - if (err) - warn("%s", name); + if (err) { + if (name != NULL) + warn("%s", name); + else + warn(NULL); + } #ifdef YP if (_use_yp) warnx("NIS information unchanged");