diff options
| author | 2013-04-21 19:46:31 +0000 | |
|---|---|---|
| committer | 2013-04-21 19:46:31 +0000 | |
| commit | de0492cf702dced2775e807e717c7234098de38b (patch) | |
| tree | ae24161a5a2948c64d28ba9dd4fb69f649bdefa8 | |
| parent | IPv6 might still be around in 2038, replace magic timeval (diff) | |
| download | wireguard-openbsd-de0492cf702dced2775e807e717c7234098de38b.tar.xz wireguard-openbsd-de0492cf702dced2775e807e717c7234098de38b.zip | |
handle exceedingly long uptimes
| -rw-r--r-- | usr.sbin/rtsold/dump.c | 7 |
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; |
