MT#62181 XmlRpcClient: add setFault()

Make it more explicit that this is meant to set the flag instead of
doing a comparison with a typo.

Change-Id: I31a1a7f35b9072f157105f6c2acdd2caf9bea09a
Warned-by: Coverity
mr13.4
Richard Fuchs 1 year ago
parent 7719eb7609
commit 6dbeb9281a

@ -528,7 +528,7 @@ XmlRpcClient::parseResponse(XmlRpcValue& result)
// Expect either <params><param>... or <fault>...
if ((XmlRpcUtil::nextTagIs(PARAMS_TAG,_response,&offset) &&
XmlRpcUtil::nextTagIs(PARAM_TAG,_response,&offset)) ||
(XmlRpcUtil::nextTagIs(FAULT_TAG,_response,&offset) && (_isFault = true)))
(XmlRpcUtil::nextTagIs(FAULT_TAG,_response,&offset) && setFault()))
{
if ( ! result.fromXml(_response, &offset)) {
XmlRpcUtil::error("Error in XmlRpcClient::parseResponse: Invalid response value. Response:\n%s", _response.c_str());

@ -141,6 +141,9 @@ namespace XmlRpc {
// Event dispatcher
XmlRpcDispatch _disp;
private:
//! Sets the fault flag and returns true.
bool setFault() { _isFault = true; return true; }
}; // class XmlRpcClient
} // namespace XmlRpc

Loading…
Cancel
Save