mirror of
https://github.com/oe7drt/YSFClients.git
synced 2026-04-07 15:24:00 +00:00
Fix bugs and simplify the blocking code.
This commit is contained in:
parent
d0602d9aa6
commit
6c3af73383
2 changed files with 41 additions and 56 deletions
|
|
@ -84,8 +84,11 @@ void CBlockList::clock(unsigned int ms)
|
|||
bool CBlockList::loadFile()
|
||||
{
|
||||
FILE* fp = ::fopen(m_file.c_str(), "rt");
|
||||
if (fp == NULL)
|
||||
if (fp == NULL) {
|
||||
m_callsigns.clear();
|
||||
LogInfo("Loaded %u callsigns from the block list", m_callsigns.size());
|
||||
return false;
|
||||
}
|
||||
|
||||
char buffer[BUFFER_SIZE];
|
||||
|
||||
|
|
@ -112,7 +115,6 @@ bool CBlockList::loadFile()
|
|||
|
||||
// Read the callsigns into the array
|
||||
m_callsigns.clear();
|
||||
unsigned int n = 0U;
|
||||
|
||||
while (::fgets(buffer, BUFFER_SIZE, fp) != NULL) {
|
||||
char* p;
|
||||
|
|
@ -129,13 +131,12 @@ bool CBlockList::loadFile()
|
|||
});
|
||||
|
||||
m_callsigns.push_back(callsign);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
::fclose(fp);
|
||||
|
||||
LogInfo("Loaded %u callsigns from the block list", n);
|
||||
LogInfo("Loaded %u callsigns from the block list", m_callsigns.size());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue