diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-03-03 09:51:27 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-03-03 09:51:27 +0900 |
| commit | 384209b8dd6fe896dfb42930d1c73e20ad38e5ec (patch) | |
| tree | bc3baded8175550802e2391e7dac3dc7b010bc8f /mrbgems | |
| parent | 187384124ba37e3c057262d1a205f1afce117af1 (diff) | |
| download | mruby-384209b8dd6fe896dfb42930d1c73e20ad38e5ec.tar.gz mruby-384209b8dd6fe896dfb42930d1c73e20ad38e5ec.zip | |
time.c: fix compile errors in `mrb_time_asctime()`.
Diffstat (limited to 'mrbgems')
| -rw-r--r-- | mrbgems/mruby-time/src/time.c | 7 |
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]; |
