*fixed semantic mistakes of buffer size.

This commit is contained in:
Wang Renxin 2017-07-26 13:43:14 +08:00
parent f3ab800bec
commit c117aaf100

View File

@ -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));