summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/c11/fmt.h6
1 files changed, 3 insertions, 3 deletions
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];
}