time.c: fix compile errors in mrb_time_asctime().

This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-03-03 09:51:27 +09:00
parent 187384124b
commit 384209b8dd
+3 -4
View File
@@ -694,14 +694,13 @@ mrb_time_asctime(mrb_state *mrb, mrb_value self)
int len;
#if defined(MRB_NO_STDIO)
char *s;
# ifdef NO_ASCTIME_R
s = asctime(d);
char *buf = asctime(d);
# else
char buf[32];
char buf[32], *s;
s = asctime_r(d, buf);
# endif
len = strlen(s)-1; /* truncate the last newline */
len = strlen(buf)-1; /* truncate the last newline */
#else
char buf[256];