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:
maartenkeijzer 2001-02-11 16:25:03 +00:00
commit 4aed181311

View file

@ -142,9 +142,9 @@ void eoParser::updateParameters() const
void eoParser::readFrom(istream& is) void eoParser::readFrom(istream& is)
{ {
string str; string str;
while (is >> str) while (is >> str)
{ {
if (str[0] == '#') if (str[0] == '#')
{ // skip the rest of the line { // skip the rest of the line
string tempStr; string tempStr;
@ -179,7 +179,9 @@ void eoParser::readFrom(istream& is)
} }
else // it should be a char 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; shortNameMap[str[1]] = value;
} }
} }