From 319bd5de45c89bb4c3f5ae4c2d6e1c4da6c36336 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Fri, 23 Aug 2019 19:57:06 +0200 Subject: [PATCH] candump: silence format-overflow warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When -Wformat-overflow= is enabled the gcc notes ... "‘sprintf’ output between 30 and 82 bytes into a destination of size xx" Increasing the buffer for the file name to 83 bytes removes the warning. Signed-off-by: Oliver Hartkopp --- candump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/candump.c b/candump.c index b6aab6c..f3b0e03 100644 --- a/candump.c +++ b/candump.c @@ -620,7 +620,7 @@ int main(int argc, char **argv) if (log) { time_t currtime; struct tm now; - char fname[sizeof("candump-2006-11-20_202026.log")+1]; + char fname[83]; /* suggested by -Wformat-overflow= */ if (time(&currtime) == (time_t)-1) { perror("time");