From bbfb64dfe62b2c5db7a726fd877232a2a210fdd0 Mon Sep 17 00:00:00 2001 From: Ross Bencina Date: Mon, 16 May 2016 19:02:09 +1000 Subject: [PATCH] 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' --- include/external/clara.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/external/clara.h b/include/external/clara.h index 6ab30136..0494745d 100644 --- a/include/external/clara.h +++ b/include/external/clara.h @@ -550,7 +550,7 @@ namespace Clara { } void parseIntoTokens( std::string const& arg, std::vector& 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;