From: Stephen Hemminger Date: Wed, 28 Jun 2023 23:35:25 +0000 (-0700) Subject: ifstat: fix warning about conditional X-Git-Tag: v6.5.0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbfccc11e1c4399f46921365b36807c3791be536;p=thirdparty%2Fiproute2.git ifstat: fix warning about conditional Gcc with warnings enabled complains because the conditional. if ((long)(a - b) < 0) could be construed as never true. Change to simple comparison. Signed-off-by: Stephen Hemminger --- diff --git a/misc/ifstat.c b/misc/ifstat.c index 4ce5ca8af..f6f9ba502 100644 --- a/misc/ifstat.c +++ b/misc/ifstat.c @@ -608,7 +608,7 @@ static void update_db(int interval) int i; for (i = 0; i < MAXS; i++) { - if ((long)(h1->ival[i] - n->ival[i]) < 0) { + if (h1->ival[i] < n->ival[i]) { memset(n->ival, 0, sizeof(n->ival)); break; }