Skip to content

Commit

Permalink
added size check
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed May 30, 2024
1 parent e0028a9 commit 4a1b0dc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions IniReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class CIniReader
{
try
{
if (m_ini.has(szSection.data()))
if (m_ini.size() && m_ini.has(szSection.data()))
{
auto& collection = m_ini[szSection.data()];
if (collection.has(szKey.data()))
Expand All @@ -134,7 +134,7 @@ class CIniReader
{
try
{
if (m_ini.has(szSection.data()))
if (m_ini.size() && m_ini.has(szSection.data()))
{
auto& collection = m_ini[szSection.data()];
if (collection.has(szKey.data()))
Expand All @@ -152,7 +152,7 @@ class CIniReader
{
try
{
if (m_ini.has(szSection.data()))
if (m_ini.size() && m_ini.has(szSection.data()))
{
auto& collection = m_ini[szSection.data()];
if (collection.has(szKey.data()))
Expand All @@ -178,7 +178,7 @@ class CIniReader
{
try
{
if (m_ini.has(szSection.data()))
if (m_ini.size() && m_ini.has(szSection.data()))
{
auto& collection = m_ini[szSection.data()];
if (collection.has(szKey.data()))
Expand All @@ -196,7 +196,7 @@ class CIniReader
}
}
catch (...) {}
return szDefaultValue.data();
return std::string(szDefaultValue);
}

void WriteInteger(std::string_view szSection, std::string_view szKey, int iValue, bool pretty = false)
Expand Down

0 comments on commit 4a1b0dc

Please sign in to comment.