From af9b59e6a1a36997d7017f4841f4a934ca1ade98 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 21 Dec 2020 23:24:11 +0100 Subject: Replace malloc + memset with calloc where appropriate calloc is faster for big allocations. It's also simpler. Signed-off-by: Rosen Penev --- tools/plistutil.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tools/plistutil.c') diff --git a/tools/plistutil.c b/tools/plistutil.c index 989db35..fd0847b 100644 --- a/tools/plistutil.c +++ b/tools/plistutil.c @@ -69,8 +69,7 @@ static options_t *parse_arguments(int argc, char *argv[]) { int i = 0; - options_t *options = (options_t *) malloc(sizeof(options_t)); - memset(options, 0, sizeof(options_t)); + options_t *options = (options_t*)calloc(1, sizeof(options_t)); options->out_fmt = 0; for (i = 1; i < argc; i++) -- cgit v1.1-32-gdbae