diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 9a962a499a..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "files.associations": { - "string": "cpp", - "charconv": "cpp" - } -} diff --git a/src/actions/rule_id.cc b/src/actions/rule_id.cc index 5bcea8e4a5..583a4471ce 100644 --- a/src/actions/rule_id.cc +++ b/src/actions/rule_id.cc @@ -17,7 +17,7 @@ #include #include -#include +#include #include "modsecurity/transaction.h" #include "modsecurity/rule.h" @@ -28,11 +28,12 @@ namespace actions { bool RuleId::init(std::string *error) { std::string a = m_parser_payload; - - const auto format = std::chars_format::fixed; - const auto conv_res = std::from_chars(a.data(), a.data() + a.size(), m_ruleId, format); - if (conv_res.ec == std::errc::invalid_argument || conv_res.ec == std::errc::result_out_of_range) { - // Conversion error + + std::stringstream ss; + ss<>m_ruleId; + if (ss.fail()) { + ss.clear(); m_ruleId = 0; error->assign("The input \"" + a + "\" does not " \ "seems to be a valid rule id.");