From 42c6b8aa78060c9bb8855fa0a1267fe8335cbdbe Mon Sep 17 00:00:00 2001 From: Egor Date: Fri, 13 Feb 2026 22:49:47 +0200 Subject: [PATCH] irc: fix some warnings --- src/irc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/irc.cpp b/src/irc.cpp index 34eb124..7d7d998 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -154,7 +154,7 @@ bool irc_parse_line(Client *client, char *p, char *end) { args[argc++] = p += is_colon; if (is_colon) { if (*p == '\n') - argc--; // empty trailing argument + argc--; // empty trailing argument (FIXME: this is against the spec) while (*p != '\n') p++; *p = '\0'; @@ -170,7 +170,7 @@ bool irc_parse_line(Client *client, char *p, char *end) { } log_client(client, "parsed: %s", command); std::string_view commandsv = command; - if (commandsv != "PASS"sv != 0 && commandsv != "OPER"sv && commandsv != "NEWACC"sv && + if (commandsv != "PASS"sv && commandsv != "OPER"sv && commandsv != "NEWACC"sv && commandsv != "AUTHENTICATE"sv && commandsv != "WEBIRC"sv) { for (int i = 0; i < argc; i++){ fprintf(stderr, " %d:%s", i, args[i]); @@ -1317,7 +1317,7 @@ static void updateNuh(Client *client) { stringlower(client->nuh); } static bool is_nick_valid(std::string_view nickname) { - if (nickname.size() < 0 || nickname.size() >= MAX_NICKLEN) + if (nickname.empty() || nickname.size() >= MAX_NICKLEN) return false; if (nickname.find_first_of(" ,*?!@$:#&~%+."sv) != std::string_view::npos) return false; -- 2.56.0