From 3da201d122a47f7bf6381b23702815474d64c471 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 16 Aug 2023 20:00:44 +0200 Subject: Update cspan docs. --- include/c11/fmt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/c11/fmt.h b/include/c11/fmt.h index df96bae3..7787bdb0 100644 --- a/include/c11/fmt.h +++ b/include/c11/fmt.h @@ -208,9 +208,9 @@ void fmt_close(fmt_stream* ss) { } const char* fmt_tm(const char *fmt, const struct tm *tp) { - static char buf[2][64], i = 1; - i = !i; - strftime(buf[i], 64, fmt, tp); + static char buf[2][64]; + static int i; + strftime(buf[(i = !i)], sizeof buf[0], fmt, tp); return buf[i]; } -- cgit v1.2.3