libvirt/src/test
Michal Privoznik 1ca3c339a1 lib: Prefer sizeof(variable) instead of sizeof(type) in memset
If one of previous commits taught us something, it's that:
sizeof(variable) and sizeof(type) are not the same. Especially
because for live enough code the type might change (e.g. as we
use autoptr more). And since we don't get any warnings when an
incorrect length is passed to memset() it is easy to mess up. But
with sizeof(variable) instead, it's not as easy. Therefore,
switch to using memset(variable, 0, sizeof(*variable)), or its
alternatives, depending on level of pointers.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
2023-08-03 16:41:19 +02:00
..
meson.build test_driver: Implement virDomainSetBlkioParameters 2021-08-19 13:31:57 +02:00
test_driver.c lib: Prefer sizeof(variable) instead of sizeof(type) in memset 2023-08-03 16:41:19 +02:00
test_driver.h
test-screenshot.png