summaryrefslogtreecommitdiffstats
path: root/lib/libpam/modules/pam_lastlog/pam_lastlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpam/modules/pam_lastlog/pam_lastlog.c')
-rw-r--r--lib/libpam/modules/pam_lastlog/pam_lastlog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libpam/modules/pam_lastlog/pam_lastlog.c b/lib/libpam/modules/pam_lastlog/pam_lastlog.c
index e6ca3ce..ff7c1d3 100644
--- a/lib/libpam/modules/pam_lastlog/pam_lastlog.c
+++ b/lib/libpam/modules/pam_lastlog/pam_lastlog.c
@@ -161,7 +161,7 @@ pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
time(&utmp.ut_time);
/* note: does not need to be NUL-terminated */
strncpy(utmp.ut_name, user, sizeof(utmp.ut_name));
- if (rhost)
+ if (rhost != NULL)
strncpy(utmp.ut_host, rhost, sizeof(utmp.ut_host));
(void)strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line));
login(&utmp);
@@ -201,7 +201,7 @@ pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
/* note: does not need to be NUL-terminated */
strncpy(ll.ll_line, tty, sizeof(ll.ll_line));
- if (rhost)
+ if (rhost != NULL)
/* note: does not need to be NUL-terminated */
strncpy(ll.ll_host, rhost, sizeof(ll.ll_host));
OpenPOWER on IntegriCloud