scc

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

commit fd0454930abb181272d930766afc8201c051d338
parent 2fc2696a9aa65501e5039cf0bfd54532d3dbcdbc
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; }