scc

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

commit a5396a9b413649c049283e949c633d7db8877ee3
parent 880f47a7e9feb9c4ac5a5a1fa4def916dc01a2cd
Author: Naveen Narayanan <zerous@simple-cc.org>
Date:   Tue, 29 Sep 2020 11:46:49 +0200

libc: Fix "%C" in strftime.c

tm_year represents the number of years since 1900.

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 @@ -252,7 +252,7 @@ strftime(char * restrict s, size_t siz, width = 4; goto number; case 'C': - val = tm->tm_year / 100; + val = (tm->tm_year + 1900) / 100; goto number; case 'H': val = tm->tm_hour;