Explicitly check result of std::strncmp

This commit is contained in:
kannibalox
2024-11-03 09:29:15 -05:00
committed by Jari Sundell
parent e367b162ab
commit 8dd8d691c5
+1 -1
View File
@@ -115,7 +115,7 @@ xml_value_to_object(const tinyxml2::XMLNode* elem) {
if (elem == nullptr) {
throw xmlrpc_error(XMLRPC_INTERNAL_ERROR, "received null element to convert");
}
if (std::strncmp(elem->Value(), "value", sizeof("value"))) {
if (std::strncmp(elem->Value(), "value", sizeof("value")) != 0) {
throw xmlrpc_error(XMLRPC_INTERNAL_ERROR, "received non-value element to convert");
}
auto root_element = elem->FirstChild();