Prefer string::find_first_of(char) where possible

This commit is contained in:
Andrew Gaul 2020-10-01 18:24:45 +09:00
parent 757f4caee8
commit eb8004c355
2 changed files with 5 additions and 5 deletions

View File

@ -2355,7 +2355,7 @@ int S3fsCurl::RequestPerform(bool dontAddAuthHeaders /*=false*/)
case CURLE_PEER_FAILED_VERIFICATION:
S3FS_PRN_ERR("### CURLE_PEER_FAILED_VERIFICATION");
first_pos = bucket.find_first_of(".");
first_pos = bucket.find_first_of('.');
if(first_pos != std::string::npos){
S3FS_PRN_INFO("curl returned a CURL_PEER_FAILED_VERIFICATION error");
S3FS_PRN_INFO("security issue found: buckets with periods in their name are incompatible with http");

View File

@ -3502,7 +3502,7 @@ static int parse_passwd_file(bucketkvmap_t& resmap)
// read '=' type
kvmap_t kv;
for(iter = linelist.begin(); iter != linelist.end(); ++iter){
first_pos = iter->find_first_of("=");
first_pos = iter->find_first_of('=');
if(first_pos == std::string::npos){
continue;
}
@ -3523,8 +3523,8 @@ static int parse_passwd_file(bucketkvmap_t& resmap)
// read ':' type
for(iter = linelist.begin(); iter != linelist.end(); ++iter){
first_pos = iter->find_first_of(":");
size_t last_pos = iter->find_last_of(":");
first_pos = iter->find_first_of(':');
size_t last_pos = iter->find_last_of(':');
if(first_pos == std::string::npos){
continue;
}
@ -4932,7 +4932,7 @@ int main(int argc, char* argv[])
// See issue #128strncasecmp
/*
if(1 == S3fsCurl::GetSslVerifyHostname()){
found = bucket.find_first_of(".");
found = bucket.find_first_of('.');
if(found != std::string::npos){
found = s3host.find("https:");
if(found != std::string::npos){