From 9203f40f41e4a735d379d13867d277c696fb28c5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 3 Sep 2022 22:52:53 +0100 Subject: Fix some warnings noticed by the readability-* clang-tidy checkers. --- src/modules/extra/m_mysql.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules/extra/m_mysql.cpp') diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index c76034cc1..51fdef06c 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -269,7 +269,7 @@ class SQLConnection final : public SQL::Provider { private: - bool EscapeString(SQL::Query* query, const std::string& in, std::string& out) + bool EscapeString(SQL::Query* query, const std::string& in, std::string& out) const { // In the worst case each character may need to be encoded as using two bytes and one // byte is the NUL terminator. @@ -281,7 +281,7 @@ private: // Unfortunately, someone genius decided that mysql_escape_string should return an // unsigned type even though -1 is returned on error so checking whether an error // happened is a bit cursed. - unsigned long escapedsize = mysql_escape_string(&buffer[0], in.c_str(), in.length()); + unsigned long escapedsize = mysql_escape_string(buffer.data(), in.c_str(), in.length()); if (escapedsize == static_cast(-1)) { SQL::Error err(SQL::QSEND_FAIL, InspIRCd::Format("%u: %s", mysql_errno(connection), mysql_error(connection))); @@ -289,7 +289,7 @@ private: return false; } - out.append(&buffer[0], escapedsize); + out.append(buffer.data(), escapedsize); return true; } -- cgit v1.3.1-10-gc9f91