[PATCH v2 08/12] clock_getres.2: Cast 'time_t' very small,values to 'int' for printf() and fix the length modifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael, here is the improved patch with Jakub's review applied.

Jakub, I added a line acknowledging your review.

Thanks,

Alex

----------------------------------------------------
From cd0e8df57be9ebee47be5c5988a980e462c89085 Mon Sep 17 00:00:00 2001
From: Alejandro Colomar <colomar.6.4.3@xxxxxxxxx>
Date: Sat, 12 Sep 2020 11:53:01 +0200
Subject: [PATCH v2 08/12] clock_getres.2: Cast 'time_t' very small
values to 'int' for printf() and fix the length modifiers

Signed-off-by: Alejandro Colomar <colomar.6.4.3@xxxxxxxxx>
Reviewed-by: Jakub Wilk <jwilk@xxxxxxxxx>
---
 man2/clock_getres.2 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/man2/clock_getres.2 b/man2/clock_getres.2
index 8fc7c6fef..0c14203ee 100644
--- a/man2/clock_getres.2
+++ b/man2/clock_getres.2
@@ -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) {
--
2.28.0



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux