summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-07-24 08:03:02 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-07-24 08:03:02 +0000
commita6411b5d5415e69ec647cd41c03e9cdec9b8034f (patch)
tree74ea84dbd48cdfbcd8a82d2bbe9e8bf6b2e28e35 /src
parentd3d39f9a3e14f73e935fb757de7e5269783b7e78 (diff)
downloadcoreutils-a6411b5d5415e69ec647cd41c03e9cdec9b8034f.tar.xz
(print_uptime) [defined BOOT_MSG]:
Don't assume ut_line is null-terminated.
Diffstat (limited to 'src')
-rw-r--r--src/uptime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/uptime.c b/src/uptime.c
index f70d9f125..90ffa32c6 100644
--- a/src/uptime.c
+++ b/src/uptime.c
@@ -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;