From: Sami Kerola Date: Mon, 15 Aug 2016 20:38:39 +0000 (+0100) Subject: warnings: fix some missed unsigned vs signed variable comparisions X-Git-Tag: v0.88~38^2^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0d72b078bf01f1a1a88b19f6359a0eeff68f7f2;p=thirdparty%2Fmtr.git warnings: fix some missed unsigned vs signed variable comparisions Commit 507092a9099a286f86639d9cd38dcdc1f28117ff fixed almost all of them, this should be the last one. --- diff --git a/report.c b/report.c index e2f858c..02ea6cb 100644 --- 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 }