mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-19 20:50:42 +01:00
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>
This commit is contained in:
parent
e23e2e391c
commit
16b960939e
@ -1,5 +1,10 @@
|
||||
---------------------------------------------------------------------------
|
||||
Version 3.20.5 [v3-stable] (rgerhards), 2009-0?-??
|
||||
- fixed bugs in RainerScript:
|
||||
o when converting a number and a string to a common type, both were
|
||||
actually converted to the other variable's type.
|
||||
o the value of rsCStrConvertToNumber() was miscalculated.
|
||||
Thanks to varmojfekoj for the patch
|
||||
- fixed a bug in configure.ac which resulted in problems with
|
||||
environment detection - thanks to Michael Biebl for the patch
|
||||
- fixed a potential segfault problem in gssapi code
|
||||
|
||||
@ -820,7 +820,7 @@ rsCStrConvertToNumber(cstr_t *pStr, number_t *pNumber)
|
||||
/* TODO: octal? hex? */
|
||||
n = 0;
|
||||
while(i < pStr->iStrLen && isdigit(pStr->pBuf[i])) {
|
||||
n = n * 10 + pStr->pBuf[i] * 10;
|
||||
n = n * 10 + pStr->pBuf[i] - '0';
|
||||
++i;
|
||||
}
|
||||
|
||||
|
||||
@ -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 */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user