]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Reset the whole stack in testutils
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 5 Jun 2017 07:38:31 +0000 (09:38 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 5 Jun 2017 07:50:51 +0000 (09:50 +0200)
commitf4c09b913ea9f4705451a6af8db41e2e3e986cc2
tree3bb6fa0a7c9764f08a6b01866ec5880588a6abec
parent0ab409ccc4ebd5713e96d164298067383ff9174d
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>
tests/testutils.c