From: Jim Meyering Date: Wed, 10 Dec 1997 10:31:25 +0000 (+0000) Subject: use NULL, '\0' instead of zeroes X-Git-Tag: FILEUTILS-3_16g~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f242b4d512d73b12848caca22e03d72112f1314;p=thirdparty%2Fcoreutils.git use NULL, '\0' instead of zeroes --- diff --git a/src/su.c b/src/su.c index dda02fe09a..bd3c5b8089 100644 --- a/src/su.c +++ b/src/su.c @@ -530,8 +530,10 @@ main (int argc, char **argv) error (1, 0, _("user %s does not exist"), new_user); endpwent (); - /* make sure pw->pw_shell is non-zero */ - if (pw->pw_shell == 0 || pw->pw_shell[0] == 0) + /* Make sure pw->pw_shell is non-NULL. It may be NULL when NEW_USER + is a username that is retrieved via NIS (YP), but that doesn't have + a default shell listed. */ + if (pw->pw_shell == NULL || pw->pw_shell[0] == '\0') pw->pw_shell = (char *) DEFAULT_SHELL; /* Make a copy of the password information and point pw at the local