bugfix, thanks to Lutz Jaenicke
diff --git a/ebtables.c b/ebtables.c
index 520d9cf..20a3bad 100644
--- a/ebtables.c
+++ b/ebtables.c
@@ -1176,16 +1176,15 @@
 		/* Do the final_check(), for all entries.
 		 * This is needed when adding a rule that has a chain target */
 		i = -1;
-		while (1) {
+		while (++i != replace->num_chains) {
 			struct ebt_u_entry *e;
 
-			i++;
 			entries = replace->chains[i];
 			if (!entries) {
 				if (i < NF_BR_NUMHOOKS)
 					continue;
 				else
-					break;
+					ebt_print_bug("whoops\n");
 			}
 			e = entries->entries->next;
 			while (e != entries->entries) {