diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-06 11:46:19 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-06 11:46:19 +0000 |
commit | 7eb0a763c32c9887dd0b1523ac154757f641e27e (patch) | |
tree | 41857f1f67db27f59f4ea3628eeca810113a8ee9 | |
parent | e4d08143bb6c246bf33cc6407bb61c5f3ce18391 (diff) | |
download | rsyslog-7eb0a763c32c9887dd0b1523ac154757f641e27e.tar.gz rsyslog-7eb0a763c32c9887dd0b1523ac154757f641e27e.tar.bz2 rsyslog-7eb0a763c32c9887dd0b1523ac154757f641e27e.zip |
fixed a bug in integer conversion
-rwxr-xr-x | srUtils.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -78,9 +78,10 @@ rsRetVal srUtilItoA(char *pBuf, int iLenBuf, int iToConv) i = 0; do { - szBuf[i] = iToConv % 10 + '0'; + szBuf[i++] = iToConv % 10 + '0'; iToConv /= 10; } while(iToConv > 0); /* warning: do...while()! */ + --i; /* undo last increment - we were pointing at NEXT location */ /* make sure we are within bounds... */ if(i + 2 > iLenBuf) /* +2 because: a) i starts at zero! b) the \0 byte */ |