summaryrefslogtreecommitdiff
path: root/sal/rtl/strtmpl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sal/rtl/strtmpl.cxx')
-rw-r--r--sal/rtl/strtmpl.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sal/rtl/strtmpl.cxx b/sal/rtl/strtmpl.cxx
index 9ec3cc6efde8..8ff170767b18 100644
--- a/sal/rtl/strtmpl.cxx
+++ b/sal/rtl/strtmpl.cxx
@@ -101,10 +101,12 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compare )( const IMPL_RTL_STRCODE* pStr1,
else
{
sal_Int32 nRet;
- while ( ((nRet = static_cast<sal_Int32>(IMPL_RTL_USTRCODE(*pStr1))-
- static_cast<sal_Int32>(IMPL_RTL_USTRCODE(*pStr2))) == 0) &&
- *pStr2 )
+ for (;;)
{
+ nRet = static_cast<sal_Int32>(IMPL_RTL_USTRCODE(*pStr1)) -
+ static_cast<sal_Int32>(IMPL_RTL_USTRCODE(*pStr2));
+ if (!(nRet == 0 && *pStr2 ))
+ break;
pStr1++;
pStr2++;
}