projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d3d39f9
)
(print_uptime) [defined BOOT_MSG]:
author
Paul Eggert
<eggert@cs.ucla.edu>
Sat, 24 Jul 2004 08:03:02 +0000
(08:03 +0000)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Sat, 24 Jul 2004 08:03:02 +0000
(08:03 +0000)
Don't assume ut_line is null-terminated.
src/uptime.c
patch
|
blob
|
history
diff --git
a/src/uptime.c
b/src/uptime.c
index f70d9f125f05620b3dd2d8b19c29e833215651d4..90ffa32c6fc65da85065b59f8191cb5e44c2fffa 100644
(file)
--- 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;