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
parent
83a1210b75
commit
319bd5de45
|
|
@ -620,7 +620,7 @@ int main(int argc, char **argv)
|
||||||
if (log) {
|
if (log) {
|
||||||
time_t currtime;
|
time_t currtime;
|
||||||
struct tm now;
|
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) {
|
if (time(&currtime) == (time_t)-1) {
|
||||||
perror("time");
|
perror("time");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue