Fix on ldns-compare-zones
@@ -293,6 +293,7 @@ main(int argc, char **argv)
ldns_rr_owner(ldns_rr_list_rr(rrl1, k))) == 0
; k++);
+
for ( l = j + 1
; l < rrc2 &&
ldns_dname_compare(ldns_rr_owner(rr2),
@@ -306,11 +307,12 @@ main(int argc, char **argv)
nc1 = k - i;
nc2 = l - j;
for ( k = i + 1, l = j + 1
- ; k < nc1 && l < nc2 &&
+ ; (k - i) < nc1 && (l - j) < nc2 &&
ldns_rr_compare(ldns_rr_list_rr(rrl1, k),
ldns_rr_list_rr(rrl2, l)) == 0
- ; k++, l++);
- if (k < nc1) {
+ ; k++, l++){
+ }
+ if ((k - i) < nc1) {
op = OP_CHG;
num_chg++;
} else {
