]> git.lyx.org Git - features.git/commitdiff
iconv_convert(): return empty vector in case of empty input
authorAbdelrazak Younes <younes@lyx.org>
Sat, 2 Sep 2006 08:01:50 +0000 (08:01 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 2 Sep 2006 08:01:50 +0000 (08:01 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14866 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/unicode.C

index aaee7fc8e1bede915c14cbab97c88351bb9435c4..9fbd818ee6f184eba5c1ad3bfcf2ef6c1736260b 100644 (file)
@@ -31,6 +31,9 @@ std::vector<char>
 iconv_convert(std::string const & tocode, std::string const & fromcode,
              std::vector<char> const & buf)
 {
+       if (buf.empty())
+               return std::vector<char>();
+
        iconv_t cd = iconv_open(tocode.c_str(), fromcode.c_str());
        if (cd == (iconv_t)(-1)) {
                lyxerr << "Error returned from iconv_open" << endl;