mirror of
https://github.com/mpv-player/mpv
synced 2024-12-15 03:15:52 +00:00
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:
parent
ed065aa6a8
commit
b44a0edd9f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user