]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
pinky: fix "d" typo
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Aug 2023 13:47:13 +0000 (06:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Aug 2023 13:52:39 +0000 (06:52 -0700)
Problem reported by Bruno Haible (bug#65003).
* src/pinky.c (idle_string): Fix recently-introduced typo:
missing "d" for "days".

src/pinky.c

index 381e753b61965046c30c0b7732c9d3d8da00c887..b6d411c8586988408feb48bc0a160ca90d6e6e9d 100644 (file)
@@ -147,7 +147,7 @@ static char const *
 idle_string (time_t when)
 {
   static time_t now = 0;
-  static char buf[INT_STRLEN_BOUND (intmax_t) + 2];
+  static char buf[INT_STRLEN_BOUND (intmax_t) + sizeof "d"];
   time_t seconds_idle;
 
   if (now == 0)
@@ -165,7 +165,7 @@ idle_string (time_t when)
   else
     {
       intmax_t days = seconds_idle / (24 * 60 * 60);
-      sprintf (buf, "%"PRIdMAX, days);
+      sprintf (buf, "%"PRIdMAX"d", days);
     }
   return buf;
 }