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");