From 14c30e2b8433d935178bbdb25a4749017d4cf4a4 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 2 Sep 2006 08:01:50 +0000 Subject: [PATCH] iconv_convert(): return empty vector in case of empty input git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14866 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/unicode.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/support/unicode.C b/src/support/unicode.C index aaee7fc8e1..9fbd818ee6 100644 --- a/src/support/unicode.C +++ b/src/support/unicode.C @@ -31,6 +31,9 @@ std::vector iconv_convert(std::string const & tocode, std::string const & fromcode, std::vector const & buf) { + if (buf.empty()) + return std::vector(); + iconv_t cd = iconv_open(tocode.c_str(), fromcode.c_str()); if (cd == (iconv_t)(-1)) { lyxerr << "Error returned from iconv_open" << endl; -- 2.39.5