mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +02:00
movieplayer: memset() with zero length is useless
This commit is contained in:
committed by
Jacek Jendrzej
parent
61dc01f719
commit
7dac1e7ad9
@@ -1461,12 +1461,11 @@ bool CMoviePlayerGui::convertSubtitle(std::string &text)
|
|||||||
size_t ilen = text.length();
|
size_t ilen = text.length();
|
||||||
size_t olen = ilen*4;
|
size_t olen = ilen*4;
|
||||||
size_t len = olen;
|
size_t len = olen;
|
||||||
char * buf = (char *) malloc(olen+1);
|
char * buf = (char *) calloc(olen + 1, 1);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
iconv_close(cd);
|
iconv_close(cd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
memset(buf, olen+1, 0);
|
|
||||||
char * out = buf;
|
char * out = buf;
|
||||||
char * in = (char *) text.c_str();
|
char * in = (char *) text.c_str();
|
||||||
if (iconv(cd, &in, &ilen, &out, &olen) == (size_t)-1) {
|
if (iconv(cd, &in, &ilen, &out, &olen) == (size_t)-1) {
|
||||||
|
Reference in New Issue
Block a user