Skip to content

Commit

Permalink
Avoid segmentation fault
Browse files Browse the repository at this point in the history
Change `<=` to `<` to avoid accessing the first character of an empty string
SSteve authored Dec 30, 2016
1 parent 7dd3723 commit 8a6fabe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/core/src/command_line_parser.cpp
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ static const char* noneValue = "<none>";
static String cat_string(const String& str)
{
int left = 0, right = (int)str.length();
while( left <= right && str[left] == ' ' )
while( left < right && str[left] == ' ' )
left++;
while( right > left && str[right-1] == ' ' )
right--;

0 comments on commit 8a6fabe

Please sign in to comment.