summaryrefslogtreecommitdiff
path: root/sw/source/filter/ascii/parasc.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/ascii/parasc.cxx')
-rw-r--r--sw/source/filter/ascii/parasc.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index a2d7bbe30508..73536d36213e 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -348,12 +348,13 @@ ErrCode SwASCIIParser::ReadChars()
else
{
pStt = pLastStt = reinterpret_cast<sal_Unicode*>(pArr.get());
- pEnd = reinterpret_cast<sal_Unicode*>(pArr.get() + lGCount);
+ auto nChars = lGCount / 2;
+ pEnd = pStt + nChars;
if( bSwapUnicode )
{
char* pF = pArr.get(), *pN = pArr.get() + 1;
- for( sal_uLong n = 0; n < lGCount; n += 2, pF += 2, pN += 2 )
+ for( sal_uLong n = 0; n < nChars; ++n, pF += 2, pN += 2 )
{
char c = *pF;
*pF = *pN;