From 8ae8374be53706bf845e781a6b332d6b83200f84 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Sun, 20 Apr 2025 19:01:45 +0200 Subject: [PATCH] Fix cppcheck errors --- src/request_body_processor/xml.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/request_body_processor/xml.cc b/src/request_body_processor/xml.cc index 1d73cbab..8c747633 100644 --- a/src/request_body_processor/xml.cc +++ b/src/request_body_processor/xml.cc @@ -37,13 +37,13 @@ NodeData::~NodeData() {}; /* * XMLNodes for parsing XML into args */ -XMLNodes::XMLNodes(Transaction *transaction) { - nodes = {}; - node_depth = 0; - currpath = ""; - currval = ""; - m_transaction = transaction; -} +XMLNodes::XMLNodes(Transaction *transaction) + : nodes{}, + node_depth(0), + currpath(""), + currval(""), + m_transaction(transaction) + {} XMLNodes::~XMLNodes() {}; @@ -76,7 +76,7 @@ class MSCSAXHandler { void onEndElement(void * ctx, const xmlChar *localname) { std::string name = reinterpret_cast(localname); XMLNodes* xml_data = static_cast(ctx); - std::shared_ptr& nd = xml_data->nodes[xml_data->nodes.size()-1]; + const std::shared_ptr& nd = xml_data->nodes[xml_data->nodes.size()-1]; if (nd->has_child == true) { // check the return value // if it false, then stop parsing