Let scaninc ignore empty C files
This commit is contained in:
parent
2c7964dbc2
commit
b6892f5b67
1 changed files with 6 additions and 1 deletions
|
@ -33,6 +33,11 @@ CFile::CFile(std::string path)
|
|||
|
||||
m_size = std::ftell(fp);
|
||||
|
||||
if (m_size < 0)
|
||||
FATAL_ERROR("File size of \"%s\" is less than zero.\n", path.c_str());
|
||||
else if (m_size == 0)
|
||||
return; // Empty file
|
||||
|
||||
m_buffer = new char[m_size + 1];
|
||||
m_buffer[m_size] = 0;
|
||||
|
||||
|
@ -49,7 +54,7 @@ CFile::CFile(std::string path)
|
|||
|
||||
CFile::~CFile()
|
||||
{
|
||||
delete[] m_buffer;
|
||||
if (m_size > 0) delete[] m_buffer;
|
||||
}
|
||||
|
||||
void CFile::FindIncbins()
|
||||
|
|
Loading…
Reference in a new issue