projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4ccd2b4
)
protect potential overflow for x86_64
author
"Vladimir N. Oleynik"
<dzo@simtreas.ru>
Tue, 31 Jan 2006 09:35:45 +0000
(09:35 -0000)
committer
"Vladimir N. Oleynik"
<dzo@simtreas.ru>
Tue, 31 Jan 2006 09:35:45 +0000
(09:35 -0000)
miscutils/last.c
patch
|
blob
|
history
diff --git
a/miscutils/last.c
b/miscutils/last.c
index d7ce5e775bc689f474230d215beb6baba99f9151..72386ea940dfbc2019d2602b50b27d195e8ca4d7 100644
(file)
--- a/
miscutils/last.c
+++ b/
miscutils/last.c
@@
-47,6
+47,7
@@
extern int last_main(int argc, char **argv)
{
struct utmp ut;
int n, file = STDIN_FILENO;
+ time_t t_tmp;
if (argc > 1) {
bb_show_usage();
@@
-98,9
+99,9
@@
extern int last_main(int argc, char **argv)
break;
}
}
-
+ t_tmp = (time_t)ut.ut_tv.tv_sec;
printf("%-10s %-14s %-18s %-12.12s\n", ut.ut_user, ut.ut_line, ut.ut_host,
- ctime(
(time_t *)&(ut.ut_tv.tv_sec)
) + 4);
+ ctime(
&t_tmp
) + 4);
}
bb_fflush_stdout_and_exit(EXIT_SUCCESS);