]> git.ipfire.org Git - thirdparty/bind9.git/commit
Convert add_quota() to a function
authorMichał Kępień <michal@isc.org>
Wed, 25 Nov 2020 11:45:47 +0000 (12:45 +0100)
committerMichał Kępień <michal@isc.org>
Wed, 25 Nov 2020 12:21:58 +0000 (13:21 +0100)
commita452798af47d2e77b73ffb0da134aedd29d65693
treeb6892bbc8e61f2f37b9abfdd608c9fbe772ad45d
parent3158a2aead4d346ef379e30345a6588217d865e0
Convert add_quota() to a function

cppcheck 2.2 reports the following false positive:

    lib/isc/tests/quota_test.c:71:21: error: Array 'quotas[101]' accessed at index 110, which is out of bounds. [arrayIndexOutOfBounds]
     isc_quota_t *quotas[110];
                        ^

The above is not even an array access, so this report is obviously
caused by a cppcheck bug.  Yet, it seems to be triggered by the presence
of the add_quota() macro, which should really be a function.  Convert
the add_quota() macro to a function in order to make the code cleaner
and to prevent the above cppcheck 2.2 false positive from being
triggered.

(cherry picked from commit ea54a932d225fc55d2a815d200c3f3b988675709)
lib/isc/tests/quota_test.c