summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authortylov <[email protected]>2023-08-13 20:24:55 +0200
committertylov <[email protected]>2023-08-13 20:24:55 +0200
commit8bb2f5618e4cefe668a663936354cf53191f2129 (patch)
treec569115cfe6901a0a1b23b8cc5e96fb4421be0b7 /include
parent972aa23a674f743c187e82444c2271aaa3e9cd06 (diff)
downloadSTC-modified-8bb2f5618e4cefe668a663936354cf53191f2129.tar.gz
STC-modified-8bb2f5618e4cefe668a663936354cf53191f2129.zip
Updated scheduler.c example.
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 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 <stdio.h>
@@ -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];