summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_dump.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2015-03-03 08:48:11 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-05-30 03:08:04 +0200
commit8f2c16aab0388ea624ea67cf9a025a662ed9a84b (patch)
treef2cff306ac8fc7cbb31680ad25b6d1966ada24bb /ospfd/ospf_dump.c
parentzclient: Revert lib export of zclient_socket()/zclient_socket_un(). (diff)
downloadfrr-8f2c16aab0388ea624ea67cf9a025a662ed9a84b.tar.xz
frr-8f2c16aab0388ea624ea67cf9a025a662ed9a84b.zip
*: use long long to print time_t
Since we can't assume time_t to be long, int, or even long long, this consistently uses %lld/long long (or %llu/unsigned long long in a few cases) to print time_t/susecond_t values. This should fix a bunch of warnings, on NetBSD in particular. (Unfortunately, there seems to be no "PRId64" style printing macro for time_t...) Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit ef008d2f8dc8f7160d8a3d24a15f2fad79ef3242)
Diffstat (limited to 'ospfd/ospf_dump.c')
-rw-r--r--ospfd/ospf_dump.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index 4c1f0549e..56dac83b7 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -299,13 +299,13 @@ ospf_timeval_dump (struct timeval *t, char *buf, size_t size)
else if (d)
snprintf (buf, size, "%1ldd%02ldh%02ldm", d, h, m);
else if (h)
- snprintf (buf, size, "%ldh%02ldm%02lds", h, m, t->tv_sec);
+ snprintf (buf, size, "%ldh%02ldm%02lds", h, m, (long)t->tv_sec);
else if (m)
- snprintf (buf, size, "%ldm%02lds", m, t->tv_sec);
+ snprintf (buf, size, "%ldm%02lds", m, (long)t->tv_sec);
else if (ms)
- snprintf (buf, size, "%ld.%03lds", t->tv_sec, ms);
+ snprintf (buf, size, "%ld.%03lds", (long)t->tv_sec, ms);
else
- snprintf (buf, size, "%ld usecs", t->tv_usec);
+ snprintf (buf, size, "%ld usecs", (long)t->tv_usec);
return buf;
}