]> git.gsnw.org Git - fping.git/commitdiff
increase some buffer sizes to eliminate -Wformat-overflow and -Wformat-truncation...
authorCharles R. Anderson <cra@wpi.edu>
Sun, 2 Feb 2020 06:17:34 +0000 (01:17 -0500)
committerCharles R. Anderson <cra@wpi.edu>
Sun, 2 Feb 2020 06:17:34 +0000 (01:17 -0500)
src/fping.c

index ea337676521d6b31ab50e91adbd68930dd4954d6..d7abe4a813d6000f805d7f6a443ff0c62bf16bd3 100644 (file)
@@ -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) */