Ver código fonte

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

Daniel-Constantin Mierla 8 anos atrás
pai
commit
de65e91dc6
2 arquivos alterados com 4 adições e 4 exclusões
  1. 2 2
      modules/pv/pv_svar.h
  2. 2 2
      modules/pv/pv_xavp.c

+ 2 - 2
modules/pv/pv_svar.h

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */

+ 2 - 2
modules/pv/pv_xavp.c

@@ -634,7 +634,7 @@ int pv_var_to_xavp(str *varname, str *xname)
 	if(varname->len==1 && varname->s[0] == '*') {
 		for(it=get_var_all(); it; it=it->next) {
 			memset(&xval, 0, sizeof(sr_xval_t));
-			if(it->v.flags&VAR_VAL_INT)
+			if(it->v.flags==VAR_VAL_INT)
 			{
 				xval.type = SR_XTYPE_INT;
 				xval.v.i = it->v.value.n;
@@ -658,7 +658,7 @@ int pv_var_to_xavp(str *varname, str *xname)
 			return -1;
 		}
 		memset(&xval, 0, sizeof(sr_xval_t));
-		if(it->v.flags&VAR_VAL_INT)
+		if(it->v.flags==VAR_VAL_INT)
 		{
 			xval.type = SR_XTYPE_INT;
 			xval.v.i = it->v.value.n;