scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 81584392c03d6ee8190dd542cda069475b5bcdc9
parent adad9f272e4784ea0bf10da9b291d60ee7e25e45
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Thu, 31 Mar 2022 20:24:44 +0200

libc: strftime: fix output for %z

strftime(buf, sizeof(buf), "%z", tm);

Gave: +00 but should be +0000.

Diffstat:
Msrc/libc/time/strftime.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libc/time/strftime.c b/src/libc/time/strftime.c @@ -154,7 +154,7 @@ timezone(char *s, size_t prec, const struct tm * restrict tm) } dval(s, 2, 2, '0', off / 3600); - dval(s, 2, 2, '0', (off % 3600) / 60); + dval(s + 2, 2, 2, '0', (off % 3600) / 60); return 5; }