From: Abdelrazak Younes Date: Wed, 18 Oct 2006 12:06:04 +0000 (+0000) Subject: add some sanity checks. X-Git-Tag: 1.6.10~12359 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=39acc2260d020f8a8b02889e07ca9c2b7fd74d4f;p=features.git add some sanity checks. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15362 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/support/unicode.C b/src/support/unicode.C index 1545e2ddc0..8779aeee8d 100644 --- a/src/support/unicode.C +++ b/src/support/unicode.C @@ -127,6 +127,9 @@ iconv_convert(iconv_t * cd, std::vector utf8_to_ucs4(std::vector const & utf8str) { + if (utf8str.empty()) + return std::vector(); + return utf8_to_ucs4(&utf8str[0], utf8str.size()); } @@ -150,6 +153,9 @@ ucs2_to_ucs4(unsigned short c) std::vector ucs2_to_ucs4(std::vector const & ucs2str) { + if (ucs2str.empty()) + return std::vector(); + return ucs2_to_ucs4(&ucs2str[0], ucs2str.size()); } @@ -173,6 +179,9 @@ ucs4_to_ucs2(lyx::char_type c) std::vector ucs4_to_ucs2(std::vector const & ucs4str) { + if (ucs4str.empty()) + return std::vector(); + return ucs4_to_ucs2(&ucs4str[0], ucs4str.size()); } @@ -197,6 +206,9 @@ ucs4_to_utf8(lyx::char_type c) std::vector ucs4_to_utf8(std::vector const & ucs4str) { + if (ucs4str.empty()) + return std::vector(); + return ucs4_to_utf8(&ucs4str[0], ucs4str.size()); }