diff --git a/modules/core/src/command_line_parser.cpp b/modules/core/src/command_line_parser.cpp index 542b231ff9..4fc62238b8 100644 --- a/modules/core/src/command_line_parser.cpp +++ b/modules/core/src/command_line_parser.cpp @@ -10,7 +10,7 @@ static const char* noneValue = ""; 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--;