summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrbgems/mruby-time/src/time.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mrbgems/mruby-time/src/time.c b/mrbgems/mruby-time/src/time.c
index 1531348de..dc236849f 100644
--- a/mrbgems/mruby-time/src/time.c
+++ b/mrbgems/mruby-time/src/time.c
@@ -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];