From 577859034db0e0e36ceab85ebba62e1018dd3361 Mon Sep 17 00:00:00 2001 From: simonb Date: Sun, 25 Jun 2006 07:18:41 +0000 Subject: fix crash when unable to convert from local to utf-8 --- ChangeLog | 2 ++ src/FbTk/FbString.cc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2723d3d..d6d5a94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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: diff --git a/src/FbTk/FbString.cc b/src/FbTk/FbString.cc index 7a0ef1b..93f6aa7 100644 --- a/src/FbTk/FbString.cc +++ b/src/FbTk/FbString.cc @@ -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 -- cgit v0.11.2