Handle npos / not found, 2nd occurrence (Coverity 55587).
This commit is contained in:
parent
4e4ff52556
commit
77b6a92f5c
@ -216,7 +216,8 @@ namespace cling {
|
||||
static const char whitespace[] = " \t\r\n";
|
||||
std::string::size_type posNonWS = content.find_first_not_of(whitespace);
|
||||
// Handle comments before leading {
|
||||
while (content[posNonWS] == '/' && content[posNonWS+1] == '/') {
|
||||
while (posNonWS != std::string::npos
|
||||
&& content[posNonWS] == '/' && content[posNonWS+1] == '/') {
|
||||
// Remove the comment line
|
||||
posNonWS = content.find_first_of('\n', posNonWS+2)+1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user