From 0f3f8285fe3dea1ce77340d1dce12ee73337338c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 30 Jan 2022 23:16:23 +0000 Subject: Fix a bunch of weird uses of .c_str(). --- src/modules/m_ojoin.cpp | 2 +- src/modules/m_sasl.cpp | 2 +- src/modules/m_websocket.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index 780f41360..caac9d0ed 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -116,7 +116,7 @@ public: ModuleOjoin() : Module(VF_VENDOR, "Adds the /OJOIN command which allows server operators to join a channel and receive the server operator-only Y (official-join) channel prefix mode.") - , np(this, ServerInstance->Config->ConfValue("ojoin")->getString("prefix").c_str()[0]) + , np(this, ServerInstance->Config->ConfValue("ojoin")->getString("prefix", "\0", 1, 1)[0]) , mycommand(this, np) { } diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 273a290bb..3fed75af7 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -280,7 +280,7 @@ public: SendSASL(this->user, this->agent, 'C', parameters); - if (parameters[0].c_str()[0] == '*') + if (parameters.empty() || parameters[0] == "*") { this->Abort(); return false; diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp index 3e3794e82..4d70ca549 100644 --- a/src/modules/m_websocket.cpp +++ b/src/modules/m_websocket.cpp @@ -286,7 +286,7 @@ class WebSocketHook final if (GetRecvQ().empty()) return 0; - unsigned char opcode = (unsigned char)GetRecvQ().c_str()[0]; + unsigned char opcode = (unsigned char)GetRecvQ()[0]; switch (opcode & ~WS_FINBIT) { case OP_CONTINUATION: -- cgit v1.3.1-10-gc9f91