diff options
Diffstat (limited to 'lib/inifile/iniFile.cpp')
-rw-r--r-- | lib/inifile/iniFile.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/inifile/iniFile.cpp b/lib/inifile/iniFile.cpp index cf8b63987..ea03f5d35 100644 --- a/lib/inifile/iniFile.cpp +++ b/lib/inifile/iniFile.cpp @@ -154,7 +154,7 @@ bool cIniFile::ReadFile(const AString & a_FileName, bool a_AllowExampleRedirect) case ';': case '#': { - if (names.size() == 0) + if (names.empty()) { AddHeaderComment(line.substr(pLeft + 1)); } @@ -168,8 +168,9 @@ bool cIniFile::ReadFile(const AString & a_FileName, bool a_AllowExampleRedirect) } // while (getline()) f.close(); - if (names.size() == 0) + if (keys.empty() && names.empty() && comments.empty()) { + // File be empty or unreadable, equivalent to nonexistant return false; } @@ -242,7 +243,7 @@ int cIniFile::FindKey(const AString & a_KeyName) const { if (CheckCase(names[keyID]) == CaseKeyName) { - return keyID; + return (int)keyID; } } return noID; @@ -278,7 +279,7 @@ int cIniFile::AddKeyName(const AString & keyname) { names.resize(names.size() + 1, keyname); keys.resize(keys.size() + 1); - return names.size() - 1; + return (int)names.size() - 1; } @@ -682,7 +683,7 @@ int cIniFile::GetNumKeyComments(const int keyID) const { if (keyID < (int)keys.size()) { - return keys[keyID].comments.size(); + return (int)keys[keyID].comments.size(); } return 0; } |