summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-05-06 15:01:59 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-06-05 07:51:47 +0200
commit5adc90960a84c738e04a8508e5d9b179e757dd0e (patch)
tree4992ab2f14f3bde896e32b63d833db3da5a506a1 /comphelper
parent273eb41f28eded48ff27561ae28882658b5099ad (diff)
Only dereference iterators after checking them
Was this way since commit edf11d28fafac50b6380c9372d0e6cf07a355616 Author Vladimir Glazounov <vg@openoffice.org> Date Thu Apr 24 16:27:52 2003 +0000 INTEGRATION: CWS uaa02 (1.3.44); FILE MERGED Surfaced after commit b1148c31ed2786396f0b018a988fce8288f1797d Author Noel Grandin <noel.grandin@collabora.co.uk> Date Wed Apr 27 16:47:53 2022 +0200 use more string_view in comphelper where the pointers were changed to iterators, which are checked in debug builds, failing an assertion. Change-Id: I87fce562aef8f50b94fb52ad6c2a79d2e84d6424 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133934 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135407 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/accessibletexthelper.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/comphelper/source/misc/accessibletexthelper.cxx b/comphelper/source/misc/accessibletexthelper.cxx
index 35fe769c1700..6bb244dd5b1a 100644
--- a/comphelper/source/misc/accessibletexthelper.cxx
+++ b/comphelper/source/misc/accessibletexthelper.cxx
@@ -682,9 +682,8 @@ namespace comphelper
const sal_Unicode* pLastDiffNew = rNewString.getStr() + nLenNew;
// find first difference
- while ((*pFirstDiffOld == *pFirstDiffNew) &&
- (pFirstDiffOld < pLastDiffOld) &&
- (pFirstDiffNew < pLastDiffNew))
+ while ((pFirstDiffOld < pLastDiffOld) && (pFirstDiffNew < pLastDiffNew)
+ && (*pFirstDiffOld == *pFirstDiffNew))
{
pFirstDiffOld++;
pFirstDiffNew++;