Removed small bug in reading outside a buffer in eoParser::readFrom
This caused the parser to crash when a simple flag of the form program -f was given.
This commit is contained in:
parent
27432e5377
commit
4aed181311
1 changed files with 4 additions and 2 deletions
|
|
@ -142,9 +142,9 @@ void eoParser::updateParameters() const
|
|||
void eoParser::readFrom(istream& is)
|
||||
{
|
||||
string str;
|
||||
|
||||
while (is >> str)
|
||||
{
|
||||
|
||||
if (str[0] == '#')
|
||||
{ // skip the rest of the line
|
||||
string tempStr;
|
||||
|
|
@ -179,7 +179,9 @@ void eoParser::readFrom(istream& is)
|
|||
}
|
||||
else // it should be a char
|
||||
{
|
||||
string value(str.begin() + 3, str.end());
|
||||
string value = "1";
|
||||
if (str.size() > 2)
|
||||
value = string(str.begin() + 3, str.end());
|
||||
shortNameMap[str[1]] = value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue