if iconv conversion failed, restore input buffer to its initial state

This commit is contained in:
Andrzej Rybczak
2009-09-23 03:43:59 +02:00
parent e99b1c63e9
commit 5866cd6343

View File

@@ -74,6 +74,7 @@ namespace
if (iconv(cd, const_cast<ICONV_CONST char **>(&inbuf), &len, &outbuf, &buflen) == size_t(-1))
{
inbuf = instart;
delete [] outstart;
iconv_close(cd);
return;