summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfctl
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2013-04-09 14:51:33 +0000
committergilles <gilles@openbsd.org>2013-04-09 14:51:33 +0000
commit035b0708d3756c01a729dc87ecce99f0b0887565 (patch)
treee9a14eb30cf16bdea46bddb6a1f5f393dedd7951 /usr.sbin/ospfctl
parentRetry when SSL_read fails with SSL_ERROR_WANT_READ. Fixes the case where (diff)
downloadwireguard-openbsd-035b0708d3756c01a729dc87ecce99f0b0887565.tar.xz
wireguard-openbsd-035b0708d3756c01a729dc87ecce99f0b0887565.zip
do not store a time_t or the result of a time_t division in an int
prompted by deraadt@, ok claudio@ chl@ guenther@
Diffstat (limited to 'usr.sbin/ospfctl')
-rw-r--r--usr.sbin/ospfctl/ospfctl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/ospfctl/ospfctl.c b/usr.sbin/ospfctl/ospfctl.c
index decd73359d7..47be03b0e7a 100644
--- a/usr.sbin/ospfctl/ospfctl.c
+++ b/usr.sbin/ospfctl/ospfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfctl.c,v 1.56 2011/05/09 12:25:35 claudio Exp $ */
+/* $OpenBSD: ospfctl.c,v 1.57 2013/04/09 14:51:33 gilles Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -521,7 +521,8 @@ fmt_timeframe_core(time_t t)
char *buf;
static char tfbuf[TF_BUFS][TF_LEN]; /* ring buffer */
static int idx = 0;
- unsigned int sec, min, hrs, day, week;
+ unsigned int sec, min, hrs, day;
+ unsigned long long week;
if (t == 0)
return ("00:00:00");
@@ -542,7 +543,7 @@ fmt_timeframe_core(time_t t)
week /= 7;
if (week > 0)
- snprintf(buf, TF_LEN, "%02uw%01ud%02uh", week, day, hrs);
+ snprintf(buf, TF_LEN, "%02lluw%01ud%02uh", week, day, hrs);
else if (day > 0)
snprintf(buf, TF_LEN, "%01ud%02uh%02um", day, hrs, min);
else