Remove unused const-cast
std::string::data now has a non-const variation in c++20. This allows
us to remove a NOLINT and follow the standard.
Tested: Login succeeds.
Change-Id: Ie49932fae8efa90afe1a238f7059924747300521
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp
index 4759e02..c06b7e9 100644
--- a/include/pam_authenticate.hpp
+++ b/include/pam_authenticate.hpp
@@ -92,8 +92,7 @@
std::string userStr(username);
std::string passStr(password);
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast)
- char* passStrNoConst = const_cast<char*>(passStr.c_str());
+ char* passStrNoConst = passStr.data();
const struct pam_conv localConversation = {pamFunctionConversation,
passStrNoConst};
pam_handle_t* localAuthHandle = nullptr; // this gets set by pam_start