fix crash on startup from iconv_close of an invalid descriptor
simonb simonb
2 files changed,
5 insertions(+),
1 deletions(-)
M
src/FbTk/FbString.cc
→
src/FbTk/FbString.cc
@@ -261,7 +261,8 @@ iconv_t newiconv = iconv_open(m_destencoding.c_str(), tempenc.c_str());
if (newiconv == ((iconv_t)(-1))) return false; else { - iconv_close(m_iconv); + if (m_iconv != ((iconv_t)-1)) + iconv_close(m_iconv); m_iconv = newiconv; return true; }