diff options
-rw-r--r-- | login-utils/sulogin.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c index 49b949a90..78a01f432 100644 --- a/login-utils/sulogin.c +++ b/login-utils/sulogin.c @@ -520,8 +520,9 @@ static void doprompt(const char *crypted, struct console *con, int deny) tty.c_oflag |= (ONLCR | OPOST); tcsetattr(con->fd, TCSADRAIN, &tty); } - if (con->file == (FILE*)0) { - if ((con->file = fdopen(con->fd, "r+")) == (FILE*)0) + if (!con->file) { + con->file = fdopen(con->fd, "r+"); + if (!con->file) goto err; } @@ -643,7 +644,7 @@ static const char *getpasswd(struct console *con) xusleep(250000); continue; } - ret = (char*)0; + ret = NULL; switch (errno) { case 0: case EIO: @@ -695,7 +696,7 @@ static const char *getpasswd(struct console *con) default: if ((size_t)(ptr - &pass[0]) >= (sizeof(pass) -1 )) { fprintf(stderr, "sulogin: input overrun at %s\n\r", con->tty); - ret = (char*)0; + ret = NULL; goto quit; } *ptr++ = ascval; |