X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/73f662acc31034cd98fdc6e157454f7763ef0792..1347f3d1e04bedd1508589173f577673ee2c5554:/stglibs/conffiles.lib/conffiles.cpp diff --git a/stglibs/conffiles.lib/conffiles.cpp b/stglibs/conffiles.lib/conffiles.cpp index 3c3f3917..4fb72f61 100644 --- a/stglibs/conffiles.lib/conffiles.cpp +++ b/stglibs/conffiles.lib/conffiles.cpp @@ -73,8 +73,9 @@ std::string Trim(std::string val) { return TrimR(TrimL(val)); } -//--------------------------------------------------------------------------- } +//--------------------------------------------------------------------------- +} // namespace anonymous //--------------------------------------------------------------------------- bool StringCaseCmp(const std::string & str1, const std::string & str2) @@ -114,8 +115,13 @@ while (getline(f, line)) return; } +<<<<<<< Updated upstream std::string parameter = Trim(line.substr(0, pos)); std::string value = Trim(line.substr(pos + 1)); +======= + std::string parameter = line.substr(0, pos); + std::string value = line.substr(pos + 1); +>>>>>>> Stashed changes param_val[parameter] = value; } } @@ -184,7 +190,7 @@ const std::map::const_iterator it(param_val.find(param if (it != param_val.end()) { char *res; - *val = strtol(it->second.c_str(), &res, 10); + *val = static_cast(strtol(it->second.c_str(), &res, 10)); if (*res != 0) { *val = defaultVal; //Error! @@ -204,7 +210,7 @@ const std::map::const_iterator it(param_val.find(param if (it != param_val.end()) { char *res; - *val = strtoul(it->second.c_str(), &res, 10); + *val = static_cast(strtoul(it->second.c_str(), &res, 10)); if (*res != 0) { *val = defaultVal; //Error!