diff options
author | Rosen Penev | 2020-12-21 23:24:11 +0100 |
---|---|---|
committer | Nikias Bassen | 2021-01-25 16:20:57 +0100 |
commit | af9b59e6a1a36997d7017f4841f4a934ca1ade98 (patch) | |
tree | f5eb124cbbfbd49b0f6195257752b62176a520ed /tools | |
parent | 7b1ccb403ad284b896a4e710fab578e397f101c0 (diff) | |
download | libplist-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')
-rw-r--r-- | tools/plistutil.c | 3 |
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++) |