summaryrefslogtreecommitdiff
path: root/src/su.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-12-10 10:31:25 +0000
committerJim Meyering <jim@meyering.net>1997-12-10 10:31:25 +0000
commit4f242b4d512d73b12848caca22e03d72112f1314 (patch)
tree3a605960b9c4f0dbb598440adca546067c958c15 /src/su.c
parent3cd84da3a607381b666856481c3feb7d9161b706 (diff)
downloadcoreutils-4f242b4d512d73b12848caca22e03d72112f1314.tar.xz
use NULL, '\0' instead of zeroes
Diffstat (limited to 'src/su.c')
-rw-r--r--src/su.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/su.c b/src/su.c
index dda02fe09..bd3c5b808 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