From 16b960939ee44155a9ac6ac6999b6ab71f237034 Mon Sep 17 00:00:00 2001 From: varmojfekoj Date: Mon, 16 Mar 2009 15:40:03 +0100 Subject: fixed bugs in RainerScript - when converting a number and a string to a common type, both were actually converted to the other variable's type. - the value of rsCStrConvertToNumber() was miscalculated. Signed-off-by: Rainer Gerhards --- runtime/var.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/var.c') diff --git a/runtime/var.c b/runtime/var.c index 7e51fc6d..f964874b 100644 --- a/runtime/var.c +++ b/runtime/var.c @@ -327,7 +327,7 @@ ConvForOperation(var_t *pThis, var_t *pOther) case VARTYPE_NUMBER: /* check if we can convert pThis to a number, if so use number format. */ iRet = ConvToNumber(pThis); - if(iRet != RS_RET_NOT_A_NUMBER) { + if(iRet == RS_RET_NOT_A_NUMBER) { CHKiRet(ConvToString(pOther)); } else { FINALIZE; /* OK or error */ @@ -345,7 +345,7 @@ ConvForOperation(var_t *pThis, var_t *pOther) break; case VARTYPE_STR: iRet = ConvToNumber(pOther); - if(iRet != RS_RET_NOT_A_NUMBER) { + if(iRet == RS_RET_NOT_A_NUMBER) { CHKiRet(ConvToString(pThis)); } else { FINALIZE; /* OK or error */ -- cgit v1.2.3