]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
cleanup: remove unnecessary null check
authorSami Kerola <kerolasa@iki.fi>
Sun, 14 Aug 2016 20:40:33 +0000 (21:40 +0100)
committerSami Kerola <kerolasa@iki.fi>
Mon, 15 Aug 2016 20:56:14 +0000 (21:56 +0100)
The fmt_ipinfo() returns variable from stack.  In order a stack variable to
point to NULL there has to go so much things wrong that the program cannot
run - effectively this can happen when system memory is so low that even
global variables cannot be allocated.

report.c

index 219bc32a5297f9fad909d0d640b35708ea2ece8d..e2f858c41ed518222e7609d8c7e8e47fd7cf46cb 100644 (file)
--- a/report.c
+++ b/report.c
@@ -458,7 +458,7 @@ void csv_close(time_t now)
 #ifdef IPINFO
     if(!ipinfo_no) {
       char* fmtinfo = fmt_ipinfo(addr);
-      if (fmtinfo != NULL) fmtinfo = trim(fmtinfo);
+      fmtinfo = trim(fmtinfo);
       printf("MTR.%s,%lld,%s,%s,%d,%s,%s", MTR_VERSION, (long long)now, "OK", Hostname,
              at+1, name, fmtinfo);
     } else