summaryrefslogtreecommitdiff
path: root/sal/rtl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2018-07-29 13:15:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-29 19:11:13 +0200
commit0955eb65b6302a072fd9b55b9cd09b62ab5dcd43 (patch)
tree226f789a8698c6f7a826dbb565696692f40ea320 /sal/rtl
parent034203742d43045df1a6a733a81fb929ee840aac (diff)
Use memmove in trim_WithLength
Change-Id: If75ac1968b8b0b3314ae36c2a7f163cb5428e9c6 Reviewed-on: https://gerrit.libreoffice.org/58277 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/rtl')
-rw-r--r--sal/rtl/strtmpl.cxx13
1 files changed, 2 insertions, 11 deletions
diff --git a/sal/rtl/strtmpl.cxx b/sal/rtl/strtmpl.cxx
index 421a615b7574..af3a28cbfec2 100644
--- a/sal/rtl/strtmpl.cxx
+++ b/sal/rtl/strtmpl.cxx
@@ -744,18 +744,9 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( trim_WithLength )( IMPL_RTL_STRCODE* pStr,
if ( nPreSpaces )
{
- IMPL_RTL_STRCODE* pNewStr = pStr+nPreSpaces;
-
nLen -= nPreSpaces;
- nIndex = nLen;
-
- while ( nIndex )
- {
- *pStr = *pNewStr;
- pStr++;
- pNewStr++;
- nIndex--;
- }
+ memmove(pStr, pStr + nPreSpaces, nLen * sizeof(IMPL_RTL_STRCODE));
+ pStr += nLen;
*pStr = 0;
}