diff options
author | Brodie Thiesfield <brofield@gmail.com> | 2007-06-30 15:14:59 +0400 |
---|---|---|
committer | Brodie Thiesfield <brofield@gmail.com> | 2007-06-30 15:14:59 +0400 |
commit | d19c3f6ee6c292e11690281d9527de5e90fa5738 (patch) | |
tree | 59562ce261c92be40af9f75b5cf70d684adc30b1 | |
parent | 31791b471b3df504bac9a5456ed8ba7c59bc6f0c (diff) |
Fix for UTF-8/unicode multiline processing
-rw-r--r-- | SimpleIni.h | 7 |
1 files 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 @@ <tr><th>File <td>SimpleIni.h <tr><th>Author <td>Brodie Thiesfield [code at jellycan dot com] <tr><th>Source <td>http://code.jellycan.com/simpleini/ - <tr><th>Version <td>4.2 + <tr><th>Version <td>4.3 </table> Jump to the @link CSimpleIniTempl CSimpleIni @endlink interface documentation. @@ -1535,8 +1535,9 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::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 |