diff options
Diffstat (limited to 'subreader.c')
-rw-r--r-- | subreader.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/subreader.c b/subreader.c index 5ac6c38abc..dcadc3083e 100644 --- a/subreader.c +++ b/subreader.c @@ -1865,8 +1865,7 @@ char** sub_filenames(const char* path, char *fname) tmpresult = malloc(len); - result = malloc(sizeof(subfn)*MAX_SUBTITLE_FILES); - memset(result, 0, sizeof(subfn)*MAX_SUBTITLE_FILES); + result = calloc(MAX_SUBTITLE_FILES, sizeof(*result)); subcnt = 0; @@ -2011,8 +2010,7 @@ char** sub_filenames(const char* path, char *fname) qsort(result, subcnt, sizeof(subfn), compare_sub_priority); - result2 = malloc(sizeof(char*)*(subcnt+1)); - memset(result2, 0, sizeof(char*)*(subcnt+1)); + result2 = calloc(subcnt + 1, sizeof(*result2)); for (i = 0; i < subcnt; i++) { result2[i] = result[i].fname; |