diff --git a/src/analyzer/protocol/http/HTTP.cc b/src/analyzer/protocol/http/HTTP.cc index e4e02b2049..83349d100a 100644 --- a/src/analyzer/protocol/http/HTTP.cc +++ b/src/analyzer/protocol/http/HTTP.cc @@ -402,7 +402,7 @@ void HTTP_Entity::SubmitHeader(mime::MIME_Header* h) return; } - size_t p = byte_range.find("/"); + size_t p = byte_range.find('/'); if ( p == string::npos ) { http_message->Weird("HTTP_content_range_cannot_parse"); @@ -412,7 +412,7 @@ void HTTP_Entity::SubmitHeader(mime::MIME_Header* h) string byte_range_resp_spec = byte_range.substr(0, p); string instance_length_str = byte_range.substr(p + 1); - p = byte_range_resp_spec.find("-"); + p = byte_range_resp_spec.find('-'); if ( p == string::npos ) { http_message->Weird("HTTP_content_range_cannot_parse"); diff --git a/src/analyzer/protocol/irc/IRC.cc b/src/analyzer/protocol/irc/IRC.cc index 5fa1c87bc1..e02789f791 100644 --- a/src/analyzer/protocol/irc/IRC.cc +++ b/src/analyzer/protocol/irc/IRC.cc @@ -34,7 +34,7 @@ void IRC_Analyzer::Done() inline void IRC_Analyzer::SkipLeadingWhitespace(string& str) { - const auto first_char = str.find_first_not_of(" "); + const auto first_char = str.find_first_not_of(' '); if ( first_char == string::npos ) str = ""; else diff --git a/src/analyzer/protocol/xmpp/xmpp-analyzer.pac b/src/analyzer/protocol/xmpp/xmpp-analyzer.pac index 26a9c69b5b..9cfb7e0bf3 100644 --- a/src/analyzer/protocol/xmpp/xmpp-analyzer.pac +++ b/src/analyzer/protocol/xmpp/xmpp-analyzer.pac @@ -13,7 +13,7 @@ refine connection XMPP_Conn += { string token = std_str(name); // Result will either be text after ":" or original string; this discards the namespace string token_no_ns = std_str(name); - auto offset = token_no_ns.find(":"); + auto offset = token_no_ns.find(':'); if ( offset != std::string::npos && token_no_ns.length() > offset + 1 ) token_no_ns = token_no_ns.substr(offset + 1); diff --git a/src/input/readers/ascii/Ascii.cc b/src/input/readers/ascii/Ascii.cc index 4a0cfea41e..2bf2cff996 100644 --- a/src/input/readers/ascii/Ascii.cc +++ b/src/input/readers/ascii/Ascii.cc @@ -130,7 +130,7 @@ bool Ascii::OpenFile() if ( fname.front() != '/' && ! path_prefix.empty() ) { string path = path_prefix; - std::size_t last = path.find_last_not_of("/"); + std::size_t last = path.find_last_not_of('/'); if ( last == string::npos ) // Nothing but slashes -- weird but ok... path = "/"; diff --git a/src/input/readers/binary/Binary.cc b/src/input/readers/binary/Binary.cc index 9964cced1e..87c38d16aa 100644 --- a/src/input/readers/binary/Binary.cc +++ b/src/input/readers/binary/Binary.cc @@ -111,7 +111,7 @@ bool Binary::DoInit(const ReaderInfo& info, int num_fields, if ( fname.front() != '/' && ! path_prefix.empty() ) { string path = path_prefix; - std::size_t last = path.find_last_not_of("/"); + std::size_t last = path.find_last_not_of('/'); if ( last == string::npos ) // Nothing but slashes -- weird but ok... path = "/"; diff --git a/src/input/readers/sqlite/SQLite.cc b/src/input/readers/sqlite/SQLite.cc index f08167ed25..821e6cdd9a 100644 --- a/src/input/readers/sqlite/SQLite.cc +++ b/src/input/readers/sqlite/SQLite.cc @@ -210,7 +210,7 @@ Value* SQLite::EntryToVal(sqlite3_stmt *st, const threading::Field *field, int p { const char *text = (const char*) sqlite3_column_text(st, pos); string s(text, sqlite3_column_bytes(st, pos)); - int pos = s.find("/"); + int pos = s.find('/'); int width = atoi(s.substr(pos+1).c_str()); string addr = s.substr(0, pos); diff --git a/src/plugin/Manager.cc b/src/plugin/Manager.cc index 39ac0568ba..c7d52a3100 100644 --- a/src/plugin/Manager.cc +++ b/src/plugin/Manager.cc @@ -48,7 +48,7 @@ void Manager::SearchDynamicPlugins(const std::string& dir) if ( dir.empty() ) return; - if ( dir.find(":") != string::npos ) + if ( dir.find(':') != string::npos ) { // Split at ":". std::stringstream s(dir); @@ -492,7 +492,7 @@ Plugin* Manager::LookupPluginByPath(std::string_view _path) if ( i != plugins_by_path.end() ) return i->second; - auto j = path.rfind("/"); + auto j = path.rfind('/'); if ( j == std::string::npos ) break; diff --git a/src/threading/formatters/Ascii.cc b/src/threading/formatters/Ascii.cc index 17c7a9e876..ce8d5461f6 100644 --- a/src/threading/formatters/Ascii.cc +++ b/src/threading/formatters/Ascii.cc @@ -300,7 +300,7 @@ threading::Value* Ascii::ParseValue(const string& s, const string& name, TypeTag case TYPE_SUBNET: { string unescaped = strstrip(get_unescaped_string(s)); - size_t pos = unescaped.find("/"); + size_t pos = unescaped.find('/'); if ( pos == unescaped.npos ) { GetThread()->Warning(GetThread()->Fmt("Invalid value for subnet: %s", start));