Skip to content

Commit

Permalink
ipf: Remove set but unused variables.
Browse files Browse the repository at this point in the history
Reported by:	clang
Differential Revision:	https://reviews.freebsd.org/D40667
  • Loading branch information
bsdjhb committed Jun 27, 2023
1 parent 235c8f6 commit 90f2fee
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sbin/ipf/ipmon/ipmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,19 +304,17 @@ static icmp_subtype_t *
find_icmpsubtype(int type, icmp_subtype_t *table, size_t tablesz)
{
icmp_subtype_t *ist;
int i;

if (tablesz < 2)
return (NULL);

if ((type < 0) || (type > table[tablesz - 2].ist_val))
return (NULL);

i = type;
if (table[type].ist_val == type)
return (table + type);

for (i = 0, ist = table; ist->ist_val != -2; i++, ist++)
for (ist = table; ist->ist_val != -2; ist++)
if (ist->ist_val == type)
return (ist);
return (NULL);
Expand All @@ -327,19 +325,17 @@ static icmp_type_t *
find_icmptype(int type, icmp_type_t *table, size_t tablesz)
{
icmp_type_t *it;
int i;

if (tablesz < 2)
return (NULL);

if ((type < 0) || (type > table[tablesz - 2].it_val))
return (NULL);

i = type;
if (table[type].it_val == type)
return (table + type);

for (i = 0, it = table; it->it_val != -2; i++, it++)
for (it = table; it->it_val != -2; it++)
if (it->it_val == type)
return (it);
return (NULL);
Expand Down

0 comments on commit 90f2fee

Please sign in to comment.