]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
address coverity side effect in assert warning
authorMark Andrews <marka@isc.org>
Mon, 19 Nov 2018 20:23:37 +0000 (07:23 +1100)
committerMark Andrews <marka@isc.org>
Thu, 22 Nov 2018 23:21:53 +0000 (10:21 +1100)
(cherry picked from commit 2156a5b6107cb3e804109dab15232ee97d3800d8)

lib/dns/tests/name_test.c

index 005ef9df05520a7c196de9c663d82d770e6dd425..21c439914b12e664c5c6912bc58453b8bf310697 100644 (file)
@@ -606,7 +606,6 @@ getlabel_test(void **state) {
                dns_fixedname_t f1, f2;
                dns_name_t *n1, *n2;
                dns_label_t l1, l2;
-               unsigned char *p1, *p2;
                unsigned int j;
 
                n1 = dns_fixedname_initname(&f1);
@@ -623,10 +622,8 @@ getlabel_test(void **state) {
                dns_name_getlabel(n2, testcases[i].pos2, &l2);
                assert_int_equal(l1.length, l2.length);
 
-               p1 = l1.base;
-               p2 = l2.base;
                for (j = 0; j < l1.length; j++) {
-                       assert_int_equal(*p1++, *p2++);
+                       assert_int_equal(l1.base[j], l2.base[j]);
                }
        }
 }