fix crash when unable to convert from local to utf-8

This commit is contained in:
simonb 2006-06-25 07:18:41 +00:00
parent 87e401edf6
commit 577859034d
2 changed files with 5 additions and 0 deletions

View file

@ -1,6 +1,8 @@
(Format: Year/Month/Day)
Changes for 1.0rc2:
*06/06/25:
* Fix crash when unable to convert between local and utf-8 encodings (Simon)
FbTk/FbString.cc
* Fix DetachClient key command so new window is visible (Mark)
Window.cc
*06/06/24:

View file

@ -130,6 +130,9 @@ std::string recode(iconv_t cd,
if (in.empty())
return "";
if (cd == ((iconv_t)(-1)))
return in; // can't convert
size_t insize = in.size();
size_t outsize = insize;
char * out = (char *) malloc(outsize * sizeof(char)); // need realloc