summaryrefslogtreecommitdiff
path: root/usr.sbin/rtsold/dump.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-04-21 19:46:32 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-04-21 19:46:32 +0000
commitd9aec1be4b0a54f118f807a716263dccd5ced856 (patch)
treefa131cb51cef0240f6648634186d9946e5d42cbc /usr.sbin/rtsold/dump.c
parentda7671b7206f65f339eefd257ffe8e1e7af89d9f (diff)
handle exceedingly long uptimes
Diffstat (limited to 'usr.sbin/rtsold/dump.c')
-rw-r--r--usr.sbin/rtsold/dump.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/rtsold/dump.c b/usr.sbin/rtsold/dump.c
index 6d670fb552a..538c6faef48 100644
--- a/usr.sbin/rtsold/dump.c
+++ b/usr.sbin/rtsold/dump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump.c,v 1.14 2013/04/21 19:42:32 florian Exp $ */
+/* $OpenBSD: dump.c,v 1.15 2013/04/21 19:46:31 deraadt Exp $ */
/* $KAME: dump.c,v 1.10 2002/05/31 10:10:03 itojun Exp $ */
/*
@@ -112,7 +112,8 @@ static char *
sec2str(time_t total)
{
static char result[256];
- int days, hours, mins, secs;
+ time_t days;
+ int hours, mins, secs;
int first = 1;
char *p = result;
char *ep = &result[sizeof(result)];
@@ -125,7 +126,7 @@ sec2str(time_t total)
if (days) {
first = 0;
- n = snprintf(p, ep - p, "%dd", days);
+ n = snprintf(p, ep - p, "%lldd", (long long)days);
if (n < 0 || n >= ep - p)
return "?";
p += n;