]> git.pond.sub.org Git - empserver/commitdiff
show: Clean up long vs. int in fmttime2822() for Windows
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 9 Jul 2017 14:39:47 +0000 (16:39 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 7 Aug 2017 07:38:32 +0000 (09:38 +0200)
fmttime2822() prints long with format %d, and passes long to abs().
Harmless, because both int and long are 32 bits in the Windows API.
Clean it up anyway.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/show.c

index c1ecac1b22c96a73cdc09422ab58b48252018935..eed35f195c662ae52a67aaa48b80010bd6532c50 100644 (file)
@@ -31,7 +31,7 @@
  *     Jeff Bailey, 1990
  *     Steve McClure, 1996
  *     Ron Koenderink, 2005-2009
- *     Markus Armbruster, 2006-2016
+ *     Markus Armbruster, 2006-2017
  */
 
 #include <config.h>
@@ -632,8 +632,8 @@ fmttime2822(time_t t)
     time_offset = -(tzi.Bias +
        (time->tm_isdst ? tzi.DaylightBias : tzi.StandardBias));
 
-    nn = _snprintf(buf + n, sizeof(buf) - n, " %+03d%02d",
-                  time_offset / 60, abs(time_offset) % 60);
+    nn = _snprintf(buf + n, sizeof(buf) - n, " %+03ld%02ld",
+                  time_offset / 60, labs(time_offset) % 60);
     if (CANT_HAPPEN(nn <= 0 || nn + n >= sizeof(buf)))
        buf[0] = 0;
 #else