summaryrefslogtreecommitdiffstats
path: root/tools/plistutil.c
diff options
context:
space:
mode:
authorGravatar Rosen Penev2020-12-21 23:24:11 +0100
committerGravatar Nikias Bassen2021-01-25 16:20:57 +0100
commitaf9b59e6a1a36997d7017f4841f4a934ca1ade98 (patch)
treef5eb124cbbfbd49b0f6195257752b62176a520ed /tools/plistutil.c
parent7b1ccb403ad284b896a4e710fab578e397f101c0 (diff)
downloadlibplist-af9b59e6a1a36997d7017f4841f4a934ca1ade98.tar.gz
libplist-af9b59e6a1a36997d7017f4841f4a934ca1ade98.tar.bz2
Replace malloc + memset with calloc where appropriate
calloc is faster for big allocations. It's also simpler. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'tools/plistutil.c')
-rw-r--r--tools/plistutil.c3
1 files changed, 1 insertions, 2 deletions
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++)