(print_uptime) [defined BOOT_MSG]:

Don't assume ut_line is null-terminated.
This commit is contained in:
Paul Eggert committed 2004-07-24 08:03:02 +00:00
1 parent d3d39f9a3e
commit a6411b5d54
1 file changed
+1 -1
+1 -1
View File
@@ -115,7 +115,7 @@ print_uptime (int n, const STRUCT_UTMP *this)
# if HAVE_PROC_UPTIME
if (uptime == 0)
# endif /* HAVE_PROC_UPTIME */
if (STREQ (this->ut_line, BOOT_MSG))
if (strncmp (this->ut_line, BOOT_MSG, sizeof this->ut_line) == 0)
boot_time = UT_TIME_MEMBER (this);
#endif /* BOOT_MSG */
++this;