[Libreoffice-commits] .: starmath/inc

Caolán McNamara caolan at kemper.freedesktop.org
Thu Mar 24 14:06:18 PDT 2011


 starmath/inc/visitors.hxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5ce5ee5c2bf3942a1531c495baac1f79b1890bfe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 24 21:05:16 2011 +0000

    cppcheck: fix crash detected by test.
    
    Might be better to not append a space if the text is blank, in which
    case adapt the regression tests. Either way don't reference before
    the start of the string

diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index b137ef2..56fb0e3 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -487,7 +487,7 @@ private:
     }
     /** Append a blank for separation, if needed */
     inline void Separate( ){
-        if( rCmdText.GetChar( rCmdText.Len( ) - 1 ) != ' ' )
+        if( !rCmdText.Len() || rCmdText.GetChar( rCmdText.Len( ) - 1 ) != ' ' )
             rCmdText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " " ) );
     }
     /** Output text generated from the pNodes */


More information about the Libreoffice-commits mailing list