candump: silence format-overflow warning

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 <socketcan@hartkopp.net>
pull/145/head
Oliver Hartkopp 2019-08-23 19:57:06 +02:00
parent 83a1210b75
commit 319bd5de45
1 changed files with 1 additions and 1 deletions

View File

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