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
This commit is contained in:
Abdelrazak Younes 2006-09-02 08:01:50 +00:00
parent 6d23395dc7
commit 14c30e2b84

View 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;