From c117aaf100a8e02b9197b6026ec1bc82628c50e7 Mon Sep 17 00:00:00 2001 From: Wang Renxin Date: Wed, 26 Jul 2017 13:43:14 +0800 Subject: [PATCH] *fixed semantic mistakes of buffer size. --- shell/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/main.c b/shell/main.c index f924128..90e12a0 100755 --- a/shell/main.c +++ b/shell/main.c @@ -1311,7 +1311,7 @@ static int now(struct mb_interpreter_t* s, void** l) { time(&ct); timeinfo = localtime(&ct); if(arg) { - strftime(buf, countof(buf), arg, timeinfo); + strftime(buf, sizeof(buf), arg, timeinfo); mb_check(mb_push_string(s, l, mb_memdup(buf, (unsigned)(strlen(buf) + 1)))); } else { arg = asctime(timeinfo); @@ -1360,7 +1360,7 @@ static int trace(struct mb_interpreter_t* s, void** l) { mb_assert(s && l); - memset(frames, 0, countof(frames)); + memset(frames, 0, sizeof(frames)); mb_check(mb_attempt_open_bracket(s, l));