movieplayer: memset() with zero length is useless

This commit is contained in:
Stefan Seyfried
2014-04-27 19:31:37 +02:00
committed by Jacek Jendrzej
parent 61dc01f719
commit 7dac1e7ad9

View File

@@ -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) {