scc

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

commit 30e021c6f5621382cffb390b75e6dce9a042a906
parent dadbaf3b0b05f72f7469e71e63c3740be090b4c7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Thu, 16 Apr 2026 10:51:50 +0200

libc/time: Fix out of bound check in strftime

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 @@ -99,7 +99,7 @@ sval(char *s, size_t siz, char **strs, int abrev, int idx, int max) if (siz == 0) return 0; - if (idx < 0 && idx >= max) { + if (idx < 0 || idx >= max) { *s = '?'; return 1; }