subreader.c: malloc+memset -> calloc

Patch by Clément Bœsch, ubitux gmail

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32417 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
cehoyos 2010-09-30 09:10:35 +00:00 committed by Uoti Urpala
parent ed065aa6a8
commit b44a0edd9f
1 changed files with 2 additions and 4 deletions

View File

@ -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;