Skip to content

Commit

Permalink
mod_fix: have commit 4e3b6b7 work on strings and pv_elem_t as well
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Feb 27, 2014
1 parent bf56024 commit 52b6793
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mod_fix.c
Expand Up @@ -983,11 +983,6 @@ int fixup_get_isvalue(struct sip_msg* msg, gparam_p gp,
}
if(value.flags&PV_VAL_STR)
{
/* Let's convert to int, if possible */
if(*flags==0 && str2sint(&value.rs, i_val)==0)
{
*flags |= GPARAM_INT_VALUE_FLAG;
}
*s_val = value.rs;
*flags |= GPARAM_STR_VALUE_FLAG;
}
Expand All @@ -996,6 +991,11 @@ int fixup_get_isvalue(struct sip_msg* msg, gparam_p gp,
LM_ERR("unexpected gp->type=[%d]\n", gp->type);
return -1;
}

/* Let's convert to int, if possible */
if (!(*flags & GPARAM_INT_VALUE_FLAG) && str2sint(s_val, i_val) == 0)
*flags |= GPARAM_INT_VALUE_FLAG;

return 0;
}

0 comments on commit 52b6793

Please sign in to comment.