Fix string iteration accesses null terminator. cppcheck complains. Alternatively, if this is intentional, a comment would be appreciated, such as: // intentional access of terminating-'\0'

This commit is contained in:
Ross Bencina 2016-05-16 19:02:09 +10:00
parent f666f5f0ae
commit bbfb64dfe6

View File

@ -550,7 +550,7 @@ namespace Clara {
}
void parseIntoTokens( std::string const& arg, std::vector<Token>& tokens ) {
for( std::size_t i = 0; i <= arg.size(); ++i ) {
for( std::size_t i = 0; i < arg.size(); ++i ) {
char c = arg[i];
if( c == '"' )
inQuotes = !inQuotes;