mirror of https://github.com/mkerrisk/man-pages
clock_getres.2: Cast 'time_t' to 'int' for printf() and fix the length modifiers
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Reviewed-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
f6fbffeae5
commit
6fd153d540
|
@ -491,8 +491,10 @@ displayClock(clockid_t clock, char *name, bool showRes)
|
|||
if (days > 0)
|
||||
printf("%ld days + ", days);
|
||||
|
||||
printf("%2ldh %2ldm %2lds", (ts.tv_sec % SECS_IN_DAY) / 3600,
|
||||
(ts.tv_sec % 3600) / 60, ts.tv_sec % 60);
|
||||
printf("%2dh %2dm %2ds",
|
||||
(int) (ts.tv_sec % SECS_IN_DAY) / 3600,
|
||||
(int) (ts.tv_sec % 3600) / 60,
|
||||
(int) ts.tv_sec % 60);
|
||||
printf(")\en");
|
||||
|
||||
if (clock_getres(clock, &ts) == \-1) {
|
||||
|
|
Loading…
Reference in New Issue