Simplified empty string comparison, added logger reporting error

This commit is contained in:
Vladyslav Baranovskyi
2024-10-14 15:20:39 +03:00
parent 372d63b5d1
commit b476563698

View File

@@ -57,8 +57,14 @@ namespace OpenVulkano
bool ArchiveReader::Open(const char* archiveFile)
{
if (std::string(archiveFile) == "")
if (archiveFile[0] == '\0')
{
if (m_logger)
{
m_logger->error("Unable to open archive file with an empty name!");
}
return false;
}
PrepOpen();
ChkErr(archive_read_open_filename(m_archive, archiveFile, BUFFER_SIZE));
ReadNextHeader();