From 6d438d42952e65be8cff6e6c6a148e238221b156 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Wed, 9 Jun 2021 18:08:48 +0200 Subject: dummyflasher: Replace another case of `sizeof(struct ...)` Using the pointer's type instead ensures that we get the right size even if code changes in the future. Change-Id: If88ba394095f86c598dcc5cf1751e1c23b132d04 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/flashrom/+/55358 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Anastasia Klimchuk --- dummyflasher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dummyflasher.c b/dummyflasher.c index b75cddb3d..6a75506dd 100644 --- a/dummyflasher.c +++ b/dummyflasher.c @@ -947,7 +947,7 @@ static int dummy_init(void) { struct stat image_stat; - struct emu_data *data = calloc(1, sizeof(struct emu_data)); + struct emu_data *data = calloc(1, sizeof(*data)); if (!data) { msg_perr("Out of memory!\n"); return 1; -- cgit v1.2.3