diff options
author | Daniel Sabogal <dsabogalcc@gmail.com> | 2018-06-11 13:15:15 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-06-26 16:44:42 -0400 |
commit | da5851e9f464f74533cc8270c932cf6466ff3256 (patch) | |
tree | 2f3f5746dfe4343216b379c8c99ced2731548f2a /src | |
parent | 63e2e40ee3aa3bdd160a7eeace98f3dfb89ddbe2 (diff) | |
download | musl-da5851e9f464f74533cc8270c932cf6466ff3256.tar.gz musl-da5851e9f464f74533cc8270c932cf6466ff3256.tar.bz2 musl-da5851e9f464f74533cc8270c932cf6466ff3256.tar.xz musl-da5851e9f464f74533cc8270c932cf6466ff3256.zip |
strftime: fix underlying format string in %z format
the expression (tm->__tm_gmtoff)/3600 has type long. use %+.2ld instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/time/strftime.c | 2 |
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; |