summaryrefslogtreecommitdiff
path: root/sal/rtl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-31 23:21:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-09-01 09:53:37 +0100
commit0a90cb6510a0d6e1889569035ae78085637c9133 (patch)
treebe53a95d135a433d29af63c219ca6ae97dae4a06 /sal/rtl
parent822a77a0c33be1a58140c8a2dcec2a02ef0cc5e7 (diff)
micro-opt, just use memset
Diffstat (limited to 'sal/rtl')
-rw-r--r--sal/rtl/source/strtmpl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sal/rtl/source/strtmpl.c b/sal/rtl/source/strtmpl.c
index bf3f4fd44600..830521d7b94f 100644
--- a/sal/rtl/source/strtmpl.c
+++ b/sal/rtl/source/strtmpl.c
@@ -31,6 +31,8 @@
/* String-Class */
/* ======================================================================= */
+#include <string.h>
+
/*
inline void rtl_str_ImplCopy( IMPL_RTL_STRCODE* pDest,
const IMPL_RTL_STRCODE* pSrc,
@@ -1049,12 +1051,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( new_WithLength )( IMPL_RTL_STRINGDATA** ppThi
{
IMPL_RTL_STRCODE* pTempStr = (*ppThis)->buffer;
- while ( nLen >= 0 )
- {
- *pTempStr = 0;
- pTempStr++;
- nLen--;
- }
+ memset(pTempStr, 0, nLen*sizeof(IMPL_RTL_STRCODE));
}
}
}