From f9915d6db350d7633aecb1ed2ba764ce4fda6fd6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 16 Aug 2018 15:58:20 +0200 Subject: sulogin: do not use plain 0 as NULL Signed-off-by: Karel Zak --- login-utils/sulogin.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'login-utils') 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; -- cgit v1.2.3-55-g7522