From b22317f80bcc98f6e8e811ed95135772e79c1c11 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 31 Jan 2017 01:49:46 +0100 Subject: mheard: Drop unsatisfiable conditions. gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -Wextra -MT mheard.o -MD -MP -MF .deps/mheard.Tpo -c -o mheard.o mheard.c [...] mheard.c:135:22: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (pr->entry.type < 0 || pr->entry.type > sizeof(types)) ^ mheard.c:168:22: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (pr->entry.type < 0 || pr->entry.type > sizeof(types)) ^ [...] Signed-off-by: Ralf Baechle --- ax25/mheard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ax25/mheard.c') diff --git a/ax25/mheard.c b/ax25/mheard.c index d1cfd0f..2acd125 100644 --- a/ax25/mheard.c +++ b/ax25/mheard.c @@ -132,7 +132,7 @@ static void PrintPortEntry(struct PortRecord *pr, int data) call = ax25_ntoa(&pr->entry.from_call); if ((s = strstr(call, "-0")) != NULL) *s = '\0'; - if (pr->entry.type < 0 || pr->entry.type > sizeof(types)) + if (pr->entry.type > sizeof(types)) return; printf("%-9s %-5s %8u %5s ", call, pr->entry.portname, pr->entry.count, types[pr->entry.type]); @@ -165,7 +165,7 @@ static void PrintPortEntry(struct PortRecord *pr, int data) case 4: if (!pr->entry.count) return; - if (pr->entry.type < 0 || pr->entry.type > sizeof(types)) + if (pr->entry.type > sizeof(types)) return; if (pr->entry.last_heard < 0 || pr->entry.first_heard < 0) return; -- cgit v1.2.3