Fix bug in strconv, take care about the end of string NULL character.

This commit is contained in:
Vreixo Formoso 2007-12-28 00:18:49 +01:00
parent c3ded11773
commit 6c7c54af93

View File

@ -60,10 +60,10 @@ int strconv(const char *str, const char *icharset, const char *ocharset,
iconv_close(conv);
return ISO_CHARSET_CONV_ERROR;
}
iconv_close(conv);
*ret = '\0';
iconv_close(conv);
*output = realloc(out, ret - out);
*output = realloc(out, ret - out + 1);
return ISO_SUCCESS;
}