]> 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 11:45:47 +0000 (12:45 +0100)
commitea54a932d225fc55d2a815d200c3f3b988675709
tree1c4fd42f95804c3643689161fd38bbabe941b56c
parent0b6216d1c702ef0aaa66a2a1bea70cfb12c81468
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.
lib/isc/tests/quota_test.c