summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-09-30 09:10:35 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:18:08 +0200
commitb44a0edd9fd1d88e7d114c3ba1f34662127981ad (patch)
tree362c3d478b01594c8f5b11a523433469ad3b89cd
parented065aa6a884748077176da4bd3afbb430a2a162 (diff)
downloadmpv-b44a0edd9fd1d88e7d114c3ba1f34662127981ad.tar.bz2
mpv-b44a0edd9fd1d88e7d114c3ba1f34662127981ad.tar.xz
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
-rw-r--r--subreader.c6
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;