From 7dac1e7ad9b2bf67e5d34902e621c9be4c71fcf8 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 27 Apr 2014 19:31:37 +0200 Subject: [PATCH] movieplayer: memset() with zero length is useless --- src/gui/movieplayer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index f0319cad7..0256f9573 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1461,12 +1461,11 @@ bool CMoviePlayerGui::convertSubtitle(std::string &text) size_t ilen = text.length(); size_t olen = ilen*4; size_t len = olen; - char * buf = (char *) malloc(olen+1); + char * buf = (char *) calloc(olen + 1, 1); if (buf == NULL) { iconv_close(cd); return ret; } - memset(buf, olen+1, 0); char * out = buf; char * in = (char *) text.c_str(); if (iconv(cd, &in, &ilen, &out, &olen) == (size_t)-1) {