diff options
| author | 2020-12-21 23:24:11 +0100 | |
|---|---|---|
| committer | 2021-01-25 16:20:57 +0100 | |
| commit | af9b59e6a1a36997d7017f4841f4a934ca1ade98 (patch) | |
| tree | f5eb124cbbfbd49b0f6195257752b62176a520ed /tools/plistutil.c | |
| 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/plistutil.c')
| -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[]) | |||
| 69 | { | 69 | { |
| 70 | int i = 0; | 70 | int i = 0; |
| 71 | 71 | ||
| 72 | options_t *options = (options_t *) malloc(sizeof(options_t)); | 72 | options_t *options = (options_t*)calloc(1, sizeof(options_t)); |
| 73 | memset(options, 0, sizeof(options_t)); | ||
| 74 | options->out_fmt = 0; | 73 | options->out_fmt = 0; |
| 75 | 74 | ||
| 76 | for (i = 1; i < argc; i++) | 75 | for (i = 1; i < argc; i++) |
