summaryrefslogtreecommitdiffstats
path: root/connectivity/source/drivers/firebird/Util.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-14 14:55:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-14 16:35:38 +0200
commit11785217594d863efb518aa8b8f2910cdcb9c59d (patch)
treed8460fe0e3a9ee4212d7bd964c2fd3ee0d9074b4 /connectivity/source/drivers/firebird/Util.cxx
parentloplugin:buriedassign in b* (diff)
downloadcore-11785217594d863efb518aa8b8f2910cdcb9c59d.tar.gz
core-11785217594d863efb518aa8b8f2910cdcb9c59d.zip
loplugin:buriedassign in c*
Change-Id: Id14fed7e5c0f588ad3c927f12251432d12c1a7c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92190 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/drivers/firebird/Util.cxx')
-rw-r--r--connectivity/source/drivers/firebird/Util.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx
index 090e34ca2781..7befd4b99014 100644
--- a/connectivity/source/drivers/firebird/Util.cxx
+++ b/connectivity/source/drivers/firebird/Util.cxx
@@ -394,11 +394,13 @@ OUString firebird::escapeWith( const OUString& sText, const char aKey, const cha
{
OUString sRet(sText);
sal_Int32 aIndex = 0;
- while( (aIndex = sRet.indexOf(aKey, aIndex)) > 0 &&
- aIndex < sRet.getLength())
+ for (;;)
{
- sRet = sRet.replaceAt(aIndex, 1, OUStringChar(aEscapeChar) + OUStringChar(aKey) );
- aIndex+= 2;
+ aIndex = sRet.indexOf(aKey, aIndex);
+ if ( aIndex <= 0 || aIndex >= sRet.getLength())
+ break;
+ sRet = sRet.replaceAt(aIndex, 1, OUStringChar(aEscapeChar) + OUStringChar(aKey) );
+ aIndex += 2;
}
return sRet;