aboutsummaryrefslogtreecommitdiff
path: root/src/modules/extra/m_mysql.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-09-03 22:52:53 +0100
committerGravatar Sadie Powell2022-09-03 23:17:05 +0100
commit9203f40f41e4a735d379d13867d277c696fb28c5 (patch)
tree93a171344e801b44918229fdd6b8778293ab88aa /src/modules/extra/m_mysql.cpp
parentFix some warnings noticed by the bugprone-* clang-tidy checkers. (diff)
Fix some warnings noticed by the readability-* clang-tidy checkers.
Diffstat (limited to 'src/modules/extra/m_mysql.cpp')
-rw-r--r--src/modules/extra/m_mysql.cpp6
1 files changed, 3 insertions, 3 deletions
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<unsigned long>(-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;
}