diff options
-rw-r--r-- | lib/libulog/ulog_login.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libulog/ulog_login.c b/lib/libulog/ulog_login.c index c51c56a31f4a..103543458485 100644 --- a/lib/libulog/ulog_login.c +++ b/lib/libulog/ulog_login.c @@ -49,7 +49,7 @@ ulog_fill(struct utmpx *utx, const char *line) utx->ut_pid = getpid(); gettimeofday(&utx->ut_tv, NULL); - strncpy(utx->ut_line, line, sizeof utx->ut_line); + strlcpy(utx->ut_line, line, sizeof utx->ut_line); SHA1_Init(&c); SHA1_Update(&c, "libulog", 7); @@ -66,9 +66,9 @@ ulog_login(const char *line, const char *user, const char *host) ulog_fill(&utx, line); utx.ut_type = USER_PROCESS; - strncpy(utx.ut_user, user, sizeof utx.ut_user); + strlcpy(utx.ut_user, user, sizeof utx.ut_user); if (host != NULL) - strncpy(utx.ut_host, host, sizeof utx.ut_host); + strlcpy(utx.ut_host, host, sizeof utx.ut_host); pututxline(&utx); } |