summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-01 21:14:15 +0000
committerAndras Timar <andras.timar@collabora.com>2018-03-06 16:44:49 +0100
commitf627ec85570a10e8c735a585d36d4d12e9573f93 (patch)
tree1c70d49067d0a8c066104f863692ce0bf5ef7360 /vcl
parente73f36315d02b328f3227bc72af8b4868a2c9192 (diff)
forcepoint #14 check to see if we incremented at all
Change-Id: Ia4670adbddcc8501cf522be296b3061a3529f880 Reviewed-on: https://gerrit.libreoffice.org/50607 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 31deb001ab1d06832caf9439c6b1c061fc20e3d9)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/helper/strhelper.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index 545f30c491d7..4a5446aabf60 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -300,9 +300,12 @@ OUString WhitespaceToSpace( const OUString& rLine, bool bProtect )
*pLeap = 0;
// there might be a space at beginning or end
- pLeap--;
- if( *pLeap == ' ' )
- *pLeap = 0;
+ if (pLeap > pBuffer)
+ {
+ pLeap--;
+ if( *pLeap == ' ' )
+ *pLeap = 0;
+ }
return OUString(*pBuffer == ' ' ? pBuffer+1 : pBuffer);
}