diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2017-01-31 01:49:46 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2017-02-06 23:43:46 +0100 |
commit | b22317f80bcc98f6e8e811ed95135772e79c1c11 (patch) | |
tree | 78702fc987b4b3fd41a714f1a66da38a932e0276 | |
parent | e1e7c6343612f23b978bc29148570137dba01563 (diff) |
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 <ralf@linux-mips.org>
-rw-r--r-- | ax25/mheard.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |