MT#62181 use `false` to indicate failure

Reverses the meaning of the return value

Change-Id: If392c5f273355fd03c55855b1b4f2a2b9c303a07
mr26.1.1
Richard Fuchs 7 months ago
parent b4cf02d4f1
commit 3393486119

@ -182,7 +182,7 @@ EXEC_ACTION_START(ZRTPGetSessionInfoAction) {
bool hex2zid(const string& zid1, char* buffer) {
for (size_t i=0;i<zid1.length()/2;i++) {
unsigned int h;
if (reverse_hex2int(zid1.substr(i*2, 2), h)) {
if (!reverse_hex2int(zid1.substr(i*2, 2), h)) {
ERROR("in zid: '%s' is no hex number\n", zid1.substr(i*2, 2).c_str());
return false;
}

@ -821,7 +821,7 @@ bool SBCCallProfile::evaluate(ParamReplacerCtx& ctx,
if (msgflags_symmetric_rtp) {
string str_msg_flags = getHeader(req.hdrs,"P-MsgFlags", true);
unsigned int msg_flags = 0;
if(reverse_hex2int(str_msg_flags,msg_flags)){
if(!reverse_hex2int(str_msg_flags,msg_flags)){
ERROR("while parsing 'P-MsgFlags' header\n");
msg_flags = 0;
}

@ -157,7 +157,7 @@ bool username2arg(const string &src, AmArg &dst)
while (pos != string::npos) {
if (pos + 2 >= encoded.size()) return false;
unsigned int c;
if (reverse_hex2int(string() + encoded[pos + 2] + encoded[pos + 1], c)) {
if (!reverse_hex2int(string() + encoded[pos + 2] + encoded[pos + 1], c)) {
DBG("%c%c does not convert from hex\n", encoded[pos + 1], encoded[pos + 2]);
return false;
}

@ -188,7 +188,7 @@ string double2str(double val) {
* Convert a reversed hex string to uint.
* @param str [in] string to convert.
* @param result [out] result integer.
* @return true if failed.
* @return true on success
*/
bool reverse_hex2int(const string& str, unsigned int& result)
{

@ -81,7 +81,7 @@ int AmZRTP::init() {
for (size_t i=0;i<sizeof(zrtp_instance_zid);i++) {
unsigned int h;
if (reverse_hex2int(zid_hex.substr(i*2, 2), h)) {
if (!reverse_hex2int(zid_hex.substr(i*2, 2), h)) {
ERROR("in zid_hex in zrtp.conf: '%s' is no hex number\n", zid_hex.substr(i*2, 2).c_str());
return -1;
}

Loading…
Cancel
Save