Use sizeof(buf) rather than hard-coding value

This commit is contained in:
Ian Barwick
2019-03-27 10:43:49 +09:00
parent 9dc928a7d5
commit a3bd9d33ff

2
log.c
View File

@@ -85,7 +85,7 @@ _stderr_log_with_level(const char *level_name, int level, const char *fmt, va_li
time(&t);
tm = localtime(&t);
strftime(buf, 100, "[%Y-%m-%d %H:%M:%S]", tm);
strftime(buf, sizeof(buf), "[%Y-%m-%d %H:%M:%S]", tm);
fprintf(stderr, "%s [%s] ", buf, level_name);
}
else