From ac0e41a8f335263ca9e0c5be42dff34a3436f1e2 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 9 Jul 2017 16:39:47 +0200 Subject: [PATCH] show: Clean up long vs. int in fmttime2822() for Windows 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 --- src/lib/subs/show.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/subs/show.c b/src/lib/subs/show.c index c1ecac1b2..eed35f195 100644 --- a/src/lib/subs/show.c +++ b/src/lib/subs/show.c @@ -31,7 +31,7 @@ * Jeff Bailey, 1990 * Steve McClure, 1996 * Ron Koenderink, 2005-2009 - * Markus Armbruster, 2006-2016 + * Markus Armbruster, 2006-2017 */ #include @@ -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 -- 2.43.0