From: Joel Stanley Date: Wed, 2 Feb 2022 12:32:48 +0000 (+1030) Subject: core: Fix gpiod_line_bulk_reset type X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=eea0d9df556718c3175002277b7f06322dfebaa6;p=qemu-gpiodev%2Flibgpiod.git core: Fix gpiod_line_bulk_reset type bulk->lines is an array of pointers, so it doesn't matter which pointer type we specify to sizeof(). As it's a struct gpiod_line *, it would make sense to use that. Signed-off-by: Joel Stanley Signed-off-by: Bartosz Golaszewski --- diff --git a/lib/core.c b/lib/core.c index 2e7ee4b..6ef09ba 100644 --- a/lib/core.c +++ b/lib/core.c @@ -117,7 +117,7 @@ GPIOD_API struct gpiod_line_bulk *gpiod_line_bulk_new(unsigned int max_lines) GPIOD_API void gpiod_line_bulk_reset(struct gpiod_line_bulk *bulk) { bulk->num_lines = 0; - memset(bulk->lines, 0, bulk->max_lines * sizeof(struct line *)); + memset(bulk->lines, 0, bulk->max_lines * sizeof(struct gpiod_line *)); } GPIOD_API void gpiod_line_bulk_free(struct gpiod_line_bulk *bulk)