Browse code

pv: pv_var_to_xavp() - proper test for type int of script var

(cherry picked from commit de65e91dc69d41277d2ba9459f0f82bcf80a01f5)

Daniel-Constantin Mierla authored on 06/11/2016 21:49:53
Showing 2 changed files
... ...
@@ -13,8 +13,8 @@
13 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 14
  * GNU General Public License for more details.
15 15
  *
16
- * You should have received a copy of the GNU General Public License 
17
- * along with this program; if not, write to the Free Software 
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program; if not, write to the Free Software
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19 19
  *
20 20
  */
... ...
@@ -634,7 +634,7 @@ int pv_var_to_xavp(str *varname, str *xname)
634 634
 	if(varname->len==1 && varname->s[0] == '*') {
635 635
 		for(it=get_var_all(); it; it=it->next) {
636 636
 			memset(&xval, 0, sizeof(sr_xval_t));
637
-			if(it->v.flags&VAR_VAL_INT)
637
+			if(it->v.flags==VAR_VAL_INT)
638 638
 			{
639 639
 				xval.type = SR_XTYPE_INT;
640 640
 				xval.v.i = it->v.value.n;
... ...
@@ -658,7 +658,7 @@ int pv_var_to_xavp(str *varname, str *xname)
658 658
 			return -1;
659 659
 		}
660 660
 		memset(&xval, 0, sizeof(sr_xval_t));
661
-		if(it->v.flags&VAR_VAL_INT)
661
+		if(it->v.flags==VAR_VAL_INT)
662 662
 		{
663 663
 			xval.type = SR_XTYPE_INT;
664 664
 			xval.v.i = it->v.value.n;