public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <colomar.6.4.3@gmail.com>
To: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Jakub Wilk <jwilk@jwilk.net>, linux-man@vger.kernel.org
Subject: [PATCH v2 08/12] clock_getres.2: Cast 'time_t' very small,values to 'int' for printf() and fix the length modifiers
Date: Sat, 12 Sep 2020 12:06:41 +0200	[thread overview]
Message-ID: <9d6f2b87-c3b8-60fc-6363-e976b7acbe8b@gmail.com> (raw)
In-Reply-To: <39788961-f3d2-af73-f6fe-9bdd79c1ca14@gmail.com>

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@gmail.com>
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@gmail.com>
Reviewed-by: Jakub Wilk <jwilk@jwilk.net>
---
  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

  reply	other threads:[~2020-09-12 10:06 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 23:14 [PATCH 00/12] printf() fixes Alejandro Colomar
2020-09-11 23:14 ` [PATCH 01/12] dl_iterate_phdr.3: Cast 'ElfN_Word' to 'uintmax_t' for printf() Alejandro Colomar
2020-09-12  5:52   ` Jakub Wilk
2020-09-12  8:31     ` Alejandro Colomar
2020-09-15  7:35       ` Jakub Wilk
2020-09-15  9:27         ` Alejandro Colomar
2020-09-11 23:14 ` [PATCH 02/12] malloc_hook.3: Remove unneeded cast, and print 'size_t' with "%zu" Alejandro Colomar
2020-09-13  5:46   ` Michael Kerrisk (man-pages)
2020-09-11 23:14 ` [PATCH 03/12] pthread_getcpuclockid.3: Cast 'time_t' to 'intmax_t' for printf() Alejandro Colomar
2020-09-13  5:58   ` Michael Kerrisk (man-pages)
2020-09-13  6:05     ` Michael Kerrisk (man-pages)
2020-09-13  8:12       ` Alejandro Colomar
2020-09-13 12:04         ` Michael Kerrisk (man-pages)
2020-09-14  8:58     ` Jakub Wilk
2020-09-14 19:38       ` Michael Kerrisk (man-pages)
2020-09-11 23:14 ` [PATCH 04/12] getgrent_r.3: Cast 'gid_t' " Alejandro Colomar
2020-09-13  6:01   ` Michael Kerrisk (man-pages)
2020-09-11 23:14 ` [PATCH 05/12] getpwent_r.3: Cast 'uid_t' " Alejandro Colomar
2020-09-13  6:01   ` Michael Kerrisk (man-pages)
2020-09-13  8:28     ` Alejandro Colomar
2020-09-13 12:04       ` Michael Kerrisk (man-pages)
2020-09-13 13:28         ` Alejandro Colomar
2020-09-13 18:11         ` Alejandro Colomar
2020-09-11 23:14 ` [PATCH 06/12] rtld-audit.7: Use "%u" rather than "%d" when printing 'unsigned int' values Alejandro Colomar
2020-09-13  5:46   ` Michael Kerrisk (man-pages)
2020-09-11 23:14 ` [PATCH 07/12] userfaultfd.2: Use 'PRIx64' rather than "%llx" when printing 64-bit fixed-width types Alejandro Colomar
2020-09-13  5:51   ` Michael Kerrisk (man-pages)
2020-09-11 23:14 ` [PATCH 08/12] clock_getres.2: Cast 'time_t' to 'intmax_t' for printf() and fix the length modifiers Alejandro Colomar
2020-09-12  5:55   ` Jakub Wilk
2020-09-12  8:32     ` Alejandro Colomar
2020-09-12 10:06       ` Alejandro Colomar [this message]
2020-09-13  6:05         ` [PATCH v2 08/12] clock_getres.2: Cast 'time_t' very small,values to 'int' " Michael Kerrisk (man-pages)
2020-09-14  9:11         ` Jakub Wilk
2020-09-14  9:48           ` Alejandro Colomar
2020-09-11 23:14 ` [PATCH 09/12] open_by_handle_at.2: Use "%u" rather than "%d" when printing 'unsigned int' values Alejandro Colomar
2020-09-13  5:46   ` Michael Kerrisk (man-pages)
2020-09-11 23:14 ` [PATCH 10/12] spu_run.2: Cast 'int' to 'unsigned int' when printing with "%x" Alejandro Colomar
2020-09-12 10:29   ` Alejandro Colomar
2020-09-13  5:54     ` Michael Kerrisk (man-pages)
2020-09-11 23:14 ` [PATCH 11/12] mprotect.2: Use "%p" rather than casting to 'long' when printing adresses (pointer values) Alejandro Colomar
2020-09-13  5:46   ` Michael Kerrisk (man-pages)
2020-09-11 23:14 ` [PATCH 12/12] pidfd_open.2: Cast 'short' to 'unsigned int' when printing with "%x" Alejandro Colomar
2020-09-13  5:55   ` Michael Kerrisk (man-pages)
2020-09-13  8:06     ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d6f2b87-c3b8-60fc-6363-e976b7acbe8b@gmail.com \
    --to=colomar.6.4.3@gmail.com \
    --cc=jwilk@jwilk.net \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox