Skip to content

Commit

Permalink
dialog: w_dlg_get_var, fix incompatible pointer
Browse files Browse the repository at this point in the history
> CC (gcc) [M dialog.so]          dialog.o
> dialog.c: In function 'w_dlg_get_var': dialog.c:1608:6: warning: assignment to 'str *' {aka 'struct _str *'} from incompatible pointer type 'sr_kemi_xval_t *' {aka 'struct sr_kemi_xval *'} [-Wincompatible-pointer-types]
> 1608 |  val = ki_dlg_get_var(msg, &sc, &sf, &st, &k);
>      |      ^
  • Loading branch information
linuxmaniac committed May 27, 2022
1 parent de70fdc commit a0d8921
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/dialog/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ static int w_dlg_get_var(struct sip_msg *msg, char *ci, char *ft, char *tt, char
str sf = STR_NULL;
str st = STR_NULL;
str k = STR_NULL;
str *val = NULL;
sr_kemi_xval_t *val = NULL;
pv_value_t dst_val;
pv_spec_t* dst_pv = (pv_spec_t *)pv;

Expand Down Expand Up @@ -1606,11 +1606,11 @@ static int w_dlg_get_var(struct sip_msg *msg, char *ci, char *ft, char *tt, char
goto error;
}
val = ki_dlg_get_var(msg, &sc, &sf, &st, &k);
if(val) {
if(val && val->vtype == SR_KEMIP_STR) {
memset(&dst_val, 0, sizeof(pv_value_t));
dst_val.flags |= PV_VAL_STR;
dst_val.rs.s = val->s;
dst_val.rs.len = val->len;
dst_val.rs.s = val->v.s.s;
dst_val.rs.len = val->v.s.len;
} else {
pv_get_null(msg, NULL, &dst_val);
}
Expand Down

0 comments on commit a0d8921

Please sign in to comment.