diff options
Diffstat (limited to 'SimpleIni.h')
-rw-r--r-- | SimpleIni.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/SimpleIni.h b/SimpleIni.h index aee5bee..b0cad33 100644 --- a/SimpleIni.h +++ b/SimpleIni.h @@ -1416,10 +1416,6 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::LoadData( { SI_CONVERTER converter(m_bStoreIsUtf8); - if (a_uDataLen == 0) { - return SI_OK; - } - // consume the UTF-8 BOM if it exists if (m_bStoreIsUtf8 && a_uDataLen >= 3) { if (memcmp(a_pData, SI_UTF8_SIGNATURE, 3) == 0) { @@ -1428,6 +1424,10 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::LoadData( } } + if (a_uDataLen == 0) { + return SI_OK; + } + // determine the length of the converted data size_t uLen = converter.SizeFromStore(a_pData, a_uDataLen); if (uLen == (size_t)(-1)) { |