summaryrefslogtreecommitdiffstats
path: root/runtime/var.c
diff options
context:
space:
mode:
authorvarmojfekoj <theinric@redhat.com>2009-03-16 15:40:03 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-03-16 15:40:03 +0100
commit16b960939ee44155a9ac6ac6999b6ab71f237034 (patch)
treeb38069bbadd5335dc56eb2c0b441327746688b89 /runtime/var.c
parente23e2e391ca1b0a5987b95f1a9f1ec8910faae8a (diff)
downloadrsyslog-16b960939ee44155a9ac6ac6999b6ab71f237034.tar.gz
rsyslog-16b960939ee44155a9ac6ac6999b6ab71f237034.tar.xz
rsyslog-16b960939ee44155a9ac6ac6999b6ab71f237034.zip
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 <rgerhards@adiscon.com>
Diffstat (limited to 'runtime/var.c')
-rw-r--r--runtime/var.c4
1 files changed, 2 insertions, 2 deletions
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 */