Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/simpleini.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SimpleIni.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/SimpleIni.h b/SimpleIni.h
index 78ebfb0..5571d64 100644
--- a/SimpleIni.h
+++ b/SimpleIni.h
@@ -1147,6 +1147,9 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::LoadFile(
if (lSize < 0) {
return SI_FILE;
}
+ if (lSize == 0) {
+ return SI_OK;
+ }
char * pData = new char[lSize];
if (!pData) {
return SI_NOMEM;
@@ -1173,6 +1176,10 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::Load(
{
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) {