mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
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>
This commit is contained in:
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user