Browse code

dialog: w_dlg_get_var, fix incompatible pointer

> 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);
> | ^

Victor Seva authored on 27/05/2022 15:18:01
Showing 1 changed files
... ...
@@ -1568,7 +1568,7 @@ static int w_dlg_get_var(struct sip_msg *msg, char *ci, char *ft, char *tt, char
1568 1568
 	str sf = STR_NULL;
1569 1569
 	str st = STR_NULL;
1570 1570
 	str k = STR_NULL;
1571
-	str *val = NULL;
1571
+	sr_kemi_xval_t *val = NULL;
1572 1572
 	pv_value_t dst_val;
1573 1573
 	pv_spec_t* dst_pv = (pv_spec_t *)pv;
1574 1574
 
... ...
@@ -1606,11 +1606,11 @@ static int w_dlg_get_var(struct sip_msg *msg, char *ci, char *ft, char *tt, char
1606 1606
 		goto error;
1607 1607
 	}
1608 1608
 	val = ki_dlg_get_var(msg, &sc, &sf, &st, &k);
1609
-	if(val) {
1609
+	if(val && val->vtype == SR_KEMIP_STR) {
1610 1610
 		memset(&dst_val, 0, sizeof(pv_value_t));
1611 1611
 		dst_val.flags |= PV_VAL_STR;
1612
-		dst_val.rs.s = val->s;
1613
-		dst_val.rs.len = val->len;
1612
+		dst_val.rs.s = val->v.s.s;
1613
+		dst_val.rs.len = val->v.s.len;
1614 1614
 	} else {
1615 1615
 		pv_get_null(msg, NULL, &dst_val);
1616 1616
 	}