From 60286c36f07cfc94950f014eb460767718721305 Mon Sep 17 00:00:00 2001 From: jhay Date: Tue, 23 Jun 2009 06:46:14 +0000 Subject: time_t does not always fit into long, for instance on arm. So rather cast it intmax_t and use %j in printf. --- sbin/sysctl/sysctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sbin/sysctl') diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index bcb5a11..4140fb3 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -365,9 +365,9 @@ S_timeval(int l2, void *p) warnx("S_timeval %d != %d", l2, sizeof(*tv)); return (1); } - printf(hflag ? "{ sec = %'ld, usec = %'ld } " : - "{ sec = %ld, usec = %ld } ", - tv->tv_sec, tv->tv_usec); + printf(hflag ? "{ sec = %'jd, usec = %'ld } " : + "{ sec = %jd, usec = %ld } ", + (intmax_t)tv->tv_sec, tv->tv_usec); tv_sec = tv->tv_sec; p1 = strdup(ctime(&tv_sec)); for (p2=p1; *p2 ; p2++) -- cgit v1.1