From d19c3f6ee6c292e11690281d9527de5e90fa5738 Mon Sep 17 00:00:00 2001 From: Brodie Thiesfield Date: Sat, 30 Jun 2007 11:14:59 +0000 Subject: Fix for UTF-8/unicode multiline processing --- SimpleIni.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SimpleIni.h b/SimpleIni.h index eaee46f..73e7485 100644 --- a/SimpleIni.h +++ b/SimpleIni.h @@ -5,7 +5,7 @@ File SimpleIni.h Author Brodie Thiesfield [code at jellycan dot com] Source http://code.jellycan.com/simpleini/ - Version 4.2 + Version 4.3 Jump to the @link CSimpleIniTempl CSimpleIni @endlink interface documentation. @@ -1535,8 +1535,9 @@ CSimpleIniTempl::LoadMultiLineText( // move this line down to the location that it should be if necessary if (pDataLine < pCurrLine) { - memmove(pDataLine, pCurrLine, a_pData - pCurrLine); - pDataLine[a_pData - pCurrLine] = '\0'; + size_t nLen = (size_t) (a_pData - pCurrLine); + memmove(pDataLine, pCurrLine, nLen * sizeof(SI_CHAR)); + pDataLine[nLen] = '\0'; } // end the line with a NULL -- cgit v1.2.3