diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-03-24 21:05:16 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-24 21:05:16 +0000 |
commit | 8baf037f970df0429f9f9d962c75185929e04081 (patch) | |
tree | f5a5217f6e119c8aec71900cb1649b74b5f93fde | |
parent | ea0cb7fcf19c9487badaa6da021336d05d078415 (diff) |
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
-rw-r--r-- | starmath/inc/visitors.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx index b137ef274527..56fb0e30e032 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 */ |