Let scaninc ignore empty C files

This commit is contained in:
GriffinR 2024-10-11 15:03:38 -04:00
parent 2c7964dbc2
commit b6892f5b67

View file

@ -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()