revise LogWarning message, and cosmetic changes

This commit is contained in:
SASANO Takayoshi 2020-03-05 19:26:02 +09:00
parent 8ff3913729
commit 92d9973ace

View file

@ -58,7 +58,7 @@ bool CUserDB::load(std::string const& filename)
{ {
FILE* fp = ::fopen(filename.c_str(), "r"); FILE* fp = ::fopen(filename.c_str(), "r");
if (fp == NULL) { if (fp == NULL) {
LogWarning("Cannot open ID lookup table - %s", filename.c_str()); LogWarning("Cannot open ID lookup file - %s", filename.c_str());
return false; return false;
} }
@ -79,7 +79,7 @@ bool CUserDB::load(std::string const& filename)
// no index - set default // no index - set default
std::unordered_map<std::string, int> index; std::unordered_map<std::string, int> index;
if (!makeindex(buffer, index)) { if (!makeindex(buffer, index)) {
::strncpy(buffer, "RADIO_ID,CALLSIGN,FIRST_NAME", sizeof(buffer)); ::strncpy(buffer, keyRADIO_ID "," keyCALLSIGN "," keyFIRST_NAME, sizeof(buffer));
makeindex(buffer, index); makeindex(buffer, index);
::rewind(fp); ::rewind(fp);
} }
@ -96,7 +96,7 @@ bool CUserDB::load(std::string const& filename)
LogInfo("Loaded %u IDs to lookup table - %s", size, filename.c_str()); LogInfo("Loaded %u IDs to lookup table - %s", size, filename.c_str());
return (size != 0U); return size != 0U;
} }
bool CUserDB::makeindex(char* buf, std::unordered_map<std::string, int>& index) bool CUserDB::makeindex(char* buf, std::unordered_map<std::string, int>& index)