(iconv_convert): Fix a crash: Don't try to create a vector from two
pointers where end is before begin.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16408
a592a061-630c-0410-9148-
cb99ea01b6c8
char * outbuf = out;
int bytes = processor.convert(inbuf, inbytesleft, outbuf, outsize);
+ if (bytes <= 0)
+ // Conversion failed
+ // FIXME Maybe throw an exception and handle that in the caller?
+ return std::vector<RetType>();
RetType const * tmp = reinterpret_cast<RetType const *>(out);
return std::vector<RetType>(tmp, tmp + bytes / sizeof(RetType));