From 9dd2f30c724a57e9df29af07546a60ac288a8310 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Wed, 27 Mar 2019 10:43:49 +0900 Subject: [PATCH] Use sizeof(buf) rather than hard-coding value --- log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log.c b/log.c index c40e4399..a6c9b709 100644 --- a/log.c +++ b/log.c @@ -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