string::substr comparisons replaced by string::compare

This commit is contained in:
eidheim 2016-12-04 14:25:11 +01:00
commit 14d848be3e
2 changed files with 2 additions and 2 deletions

View file

@ -304,7 +304,7 @@ namespace SimpleWeb {
size_t protocol_end;
if((protocol_end=line.find('/', path_end+1))!=std::string::npos) {
if(line.substr(path_end+1, protocol_end-path_end-1)!="HTTP")
if(line.compare(path_end+1, protocol_end-path_end-1, "HTTP")!=0)
return false;
request->http_version=line.substr(protocol_end+1, line.size()-protocol_end-2);
}