From f8f8f293237027e8d4798545e9cb2f8a6bd0124f Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Tue, 25 Jun 2002 15:43:57 +0000 Subject: minor bugfix --- ebtables.c | 7 ++++--- extensions/ebt_ip.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ebtables.c b/ebtables.c index 48861f3..aac9762 100644 --- a/ebtables.c +++ b/ebtables.c @@ -518,7 +518,7 @@ static void list_em(struct ebt_u_entries *entries) printf("nr. of entries: %d \n", entries->nentries); i = entries->nentries; - while (i >9) { + while (i > 9) { space++; i /= 10; } @@ -526,6 +526,7 @@ static void list_em(struct ebt_u_entries *entries) for (i = 0; i < entries->nentries; i++) { digits = 0; // A little work to get nice rule numbers. + j = i + 1; while (j > 9) { digits++; j /= 10; @@ -969,11 +970,11 @@ static int flush_chains() if ( !(counterchanges = (unsigned short *) malloc((oldnentries + 1) * sizeof(unsigned short))) ) print_memory(); - cnt = counterchanges; } // delete the counters belonging to the specified chain, // update counter_offset i = -1; + cnt = counterchanges; while (1) { i++; entries = nr_to_chain(i); @@ -1511,7 +1512,7 @@ int main(int argc, char *argv[]) int c, i; // this special one for the -Z option (we can have -Z -L ) int zerochain = -1; - int policy; + int policy = 0; int rule_nr = -1;// used for -D chain number struct ebt_u_target *t; struct ebt_u_match *m; diff --git a/extensions/ebt_ip.c b/extensions/ebt_ip.c index 71d7f30..0deb3e0 100644 --- a/extensions/ebt_ip.c +++ b/extensions/ebt_ip.c @@ -155,7 +155,7 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, unsigned int *flags, struct ebt_entry_match **match) { struct ebt_ip_info *ipinfo = (struct ebt_ip_info *)(*match)->data; - char *end, *buffer; + char *end; int i; switch (c) { @@ -193,7 +193,7 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, if (optind > argc) print_error("Missing ip tos argument"); i = strtol(argv[optind - 1], &end, 16); - if (i < 0 || i > 255 || *buffer != '\0') + if (i < 0 || i > 255 || *end != '\0') print_error("Problem with specified ip tos"); ipinfo->tos = i; ipinfo->bitmask |= EBT_IP_TOS; -- cgit v1.2.3