summaryrefslogtreecommitdiff
path: root/src/time
diff options
context:
space:
mode:
authorDaniel Sabogal <dsabogalcc@gmail.com>2018-06-11 13:15:15 -0400
committerRich Felker <dalias@aerifal.cx>2018-06-26 16:44:42 -0400
commitda5851e9f464f74533cc8270c932cf6466ff3256 (patch)
tree2f3f5746dfe4343216b379c8c99ced2731548f2a /src/time
parent63e2e40ee3aa3bdd160a7eeace98f3dfb89ddbe2 (diff)
downloadmusl-da5851e9f464f74533cc8270c932cf6466ff3256.tar.gz
strftime: fix underlying format string in %z format
the expression (tm->__tm_gmtoff)/3600 has type long. use %+.2ld instead.
Diffstat (limited to 'src/time')
-rw-r--r--src/time/strftime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/time/strftime.c b/src/time/strftime.c
index 708875ee..0a256970 100644
--- a/src/time/strftime.c
+++ b/src/time/strftime.c
@@ -181,7 +181,7 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *
*l = 0;
return "";
}
- *l = snprintf(*s, sizeof *s, "%+.2d%.2d",
+ *l = snprintf(*s, sizeof *s, "%+.2ld%.2d",
(tm->__tm_gmtoff)/3600,
abs(tm->__tm_gmtoff%3600)/60);
return *s;