Skip to content
Snippets Groups Projects
Commit 2e69b5a7 authored by Mark Jenkinson's avatar Mark Jenkinson
Browse files

changed substr call, as it actually requires (initial position, length)

NOT (initial position, final position)
parent afaf0aed
No related branches found
No related tags found
No related merge requests found
......@@ -23,9 +23,9 @@ bool BaseOption::matches(const string& arg)
{
string::size_type pos = 0, np;
while((np = key_.find(",", pos)) != string::npos) {
if(arg == key_.substr(pos, np))
if(arg == key_.substr(pos, np - pos))
return true;
pos = np+1;
pos = np + 1;
}
if(arg == key_.substr(pos, string::npos))
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment