From: Charles R. Anderson Date: Sun, 2 Feb 2020 06:17:34 +0000 (-0500) Subject: increase some buffer sizes to eliminate -Wformat-overflow and -Wformat-truncation... X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a75a6f8675c5e2263feb3380d3d04ee4e81f7f88;p=fping.git increase some buffer sizes to eliminate -Wformat-overflow and -Wformat-truncation warnings --- diff --git a/src/fping.c b/src/fping.c index ea33767..d7abe4a 100644 --- a/src/fping.c +++ b/src/fping.c @@ -2339,7 +2339,7 @@ void add_name(char* name) } if (name_flag || rdns_flag) { - char nameaddrbuf[512]; + char nameaddrbuf[512+3]; snprintf(nameaddrbuf, sizeof(nameaddrbuf) / sizeof(char), "%s (%s)", printname, addrbuf); add_addr(name, nameaddrbuf, res->ai_addr, res->ai_addrlen); } @@ -2583,7 +2583,7 @@ void timeval_add(struct timeval* a, long t_10u) char* sprint_tm(int t) { - static char buf[10]; + static char buf[12]; if (t < 0) { /* negative (unexpected) */