From eea0d9df556718c3175002277b7f06322dfebaa6 Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Wed, 2 Feb 2022 23:02:48 +1030 Subject: [PATCH] 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 --- lib/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.30.2