COMMON: Fix encoding conversion using iconv

It was not always setting to 0 all the newly allocated bytes,
and if you were unlucky this could result in additional spurious
characters at the end of the converted string.
This commit is contained in:
Thierry Crozat 2020-08-17 23:54:07 +01:00 committed by Eugene Sandulenko
parent f9b05f5e5a
commit 58203e09fd

View File

@ -235,7 +235,7 @@ char *Encoding::convertIconv(const char *to, const char *from, const char *strin
}
dst = buffer + (dst - oldString);
outSize = stringSize - (dst - buffer);
memset(dst, 0, stringSize / 2);
memset(dst, 0, outSize);
} else {
error = true;
break;