mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 15:05:17 +00:00
Reset the whole stack in testutils
The memset() was resetting only 30 bytes in the array (size of the array), but it is array of pointers. Since it is a static array, let's just reset it by its size. Found by gcc-7.1: testutils.c: In function 'virTestRun': testutils.c:243:13: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size] memset(testAllocStack, 0, ARRAY_CARDINALITY(testAllocStack)); ^~~~~~ Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
0ab409ccc4
commit
f4c09b913e
@ -240,7 +240,7 @@ virTestRun(const char *title,
|
|||||||
for (i = start; i < end; i++) {
|
for (i = start; i < end; i++) {
|
||||||
bool missingFail = false;
|
bool missingFail = false;
|
||||||
# ifdef TEST_OOM_TRACE
|
# ifdef TEST_OOM_TRACE
|
||||||
memset(testAllocStack, 0, ARRAY_CARDINALITY(testAllocStack));
|
memset(testAllocStack, 0, sizeof(testAllocStack));
|
||||||
ntestAllocStack = 0;
|
ntestAllocStack = 0;
|
||||||
# endif
|
# endif
|
||||||
virAllocTestOOM(i + 1, 1);
|
virAllocTestOOM(i + 1, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user