From 8bb2f5618e4cefe668a663936354cf53191f2129 Mon Sep 17 00:00:00 2001 From: tylov Date: Sun, 13 Aug 2023 20:24:55 +0200 Subject: Updated scheduler.c example. --- include/c11/fmt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/c11/fmt.h') diff --git a/include/c11/fmt.h b/include/c11/fmt.h index d2eab8bc..d7c10cbe 100644 --- a/include/c11/fmt.h +++ b/include/c11/fmt.h @@ -63,8 +63,8 @@ int main(void) { time_t now = time(NULL); struct tm t1 = *localtime(&now), t2 = t1; t2.tm_year += 2; - fmt_print(1, "Dates:\n {}\n {}\n", fmt_tm("%Y-%m-%d %X %Z", &t1), - fmt_tm("%Y-%m-%d %X %Z", &t2)); + fmt_print("Dates:\n {}\n {}\n", fmt_tm("%Y-%m-%d %X %Z", &t1), + fmt_tm("%Y-%m-%d %X %Z", &t2)); } */ #include @@ -208,7 +208,7 @@ void fmt_close(fmt_stream* ss) { } const char* fmt_tm(const char *fmt, const struct tm *tp) { - static char buf[2][64], i = 0; + static char buf[2][64], i = 1; i = !i; strftime(buf[i], 64, fmt, tp); return buf[i]; -- cgit v1.2.3