mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 15:02:56 +02:00
libconfigfile: accept booleans as int32 or int64
for compatibility if config file entry is changed from boolean to int32 or int64 based on patch by martii <m4rtii@gmx.de> in Neutrino-MP Git
This commit is contained in:
committed by
svenhoefer
parent
253579909f
commit
ad498249d1
@@ -204,6 +204,10 @@ int32_t CConfigFile::getInt32(const std::string & key, const int32_t defaultVal)
|
||||
}
|
||||
}
|
||||
|
||||
if (configData[key] == "false")
|
||||
return 0;
|
||||
if (configData[key] == "true")
|
||||
return 1;
|
||||
return atoi(configData[key].c_str());
|
||||
}
|
||||
|
||||
@@ -225,6 +229,10 @@ int64_t CConfigFile::getInt64(const std::string & key, const int64_t defaultVal)
|
||||
}
|
||||
}
|
||||
|
||||
if (configData[key] == "false")
|
||||
return 0;
|
||||
if (configData[key] == "true")
|
||||
return 1;
|
||||
return atoll(configData[key].c_str());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user