mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 06:49:28 -05:00
feat: fail to parse info strings on empty keys
This commit is contained in:
@ -185,6 +185,16 @@ bool InfoString::FromStream(const std::string& prefix, std::istream& stream)
|
||||
std::string key;
|
||||
while (infoStream.NextField(key))
|
||||
{
|
||||
if (key.empty())
|
||||
{
|
||||
if (m_keys_by_insertion.empty())
|
||||
std::cerr << "Invalid info string: Got empty key at the start of the info string\n";
|
||||
else
|
||||
std::cerr << "Invalid info string: Got empty key after key \"" << m_keys_by_insertion[m_keys_by_insertion.size() - 1] << "\"\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string value;
|
||||
if (!infoStream.NextField(value))
|
||||
{
|
||||
|
Reference in New Issue
Block a user