time_t does not always fit into long, for instance on arm. So rather cast

it intmax_t and use %j in printf.
This commit is contained in:
John Hay 2009-06-23 06:46:14 +00:00
parent 991633af2e
commit db87e2dc03
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=194684

View File

@ -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++)