mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 00:25:44 +00:00
feat: fail to parse info strings on empty keys
This commit is contained in:
parent
5d913acfef
commit
3efd9534fb
@ -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))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user