]> git.lyx.org Git - features.git/commitdiff
make _GLIBCXX_DEBUG_PEDASSERT happy
authorAndré Pönitz <poenitz@gmx.net>
Tue, 17 Jun 2008 16:33:19 +0000 (16:33 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 17 Jun 2008 16:33:19 +0000 (16:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25295 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/docstring.cpp

index 6de9424c1b5822d2d963b4a0e22e3b93d2b5f426..b3417f7f26cd6a889a5e7d73f2a566eae4ccaf7b 100644 (file)
@@ -31,12 +31,13 @@ namespace lyx {
 docstring const from_ascii(char const * ascii)
 {
        docstring s;
-       int n = strlen(ascii);
-       s.resize(n);
-       char_type *d = &s[0];
-       while (--n >= 0) {
-               d[n] = ascii[n];
-               LASSERT(static_cast<unsigned char>(ascii[n]) < 0x80, /**/);
+       if (int n = strlen(ascii)) {
+               s.resize(n);
+               char_type *d = &s[0];
+               while (--n >= 0) {
+                       d[n] = ascii[n];
+                       LASSERT(static_cast<unsigned char>(ascii[n]) < 0x80, /**/);
+               }
        }
        return s;
 }