]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
warnings: fix some missed unsigned vs signed variable comparisions
authorSami Kerola <kerolasa@iki.fi>
Mon, 15 Aug 2016 20:38:39 +0000 (21:38 +0100)
committerSami Kerola <kerolasa@iki.fi>
Tue, 16 Aug 2016 09:52:09 +0000 (10:52 +0100)
Commit 507092a9099a286f86639d9cd38dcdc1f28117ff fixed almost all of them,
this should be the last one.

report.c

index e2f858c41ed518222e7609d8c7e8e47fd7cf46cb..02ea6cbe74fc3f7ec27dc151523ac8b86fd98ef1 100644 (file)
--- a/report.c
+++ b/report.c
@@ -93,8 +93,8 @@ void report_close(void)
   char name[81];
   char buf[1024];
   char fmt[16];
-  int len=0;
-  int len_hosts = 33;
+  size_t len=0;
+  size_t len_hosts = 33;
 
   if (reportwide)
   {
@@ -103,7 +103,7 @@ void report_close(void)
     max = net_max();
     at  = net_min();
     for (; at < max; at++) {
-      int nlen;
+      size_t nlen;
       addr = net_addr(at);
       if ((nlen = snprint_addr(name, sizeof(name), addr)))
         if (len_hosts < nlen)
@@ -147,11 +147,11 @@ void report_close(void)
 
 #ifdef IPINFO
     if (is_printii()) {
-      snprintf(fmt, sizeof(fmt), " %%2d. %%s%%-%ds", len_hosts);
+      snprintf(fmt, sizeof(fmt), " %%2d. %%s%%-%zus", len_hosts);
       snprintf(buf, sizeof(buf), fmt, at+1, fmt_ipinfo(addr), name);
     } else {
 #endif
-    snprintf( fmt, sizeof(fmt), " %%2d.|-- %%-%ds", len_hosts);
+    snprintf( fmt, sizeof(fmt), " %%2d.|-- %%-%zus", len_hosts);
     snprintf(buf, sizeof(buf), fmt, at+1, name);
 #ifdef IPINFO
     }