summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-06 11:46:19 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-06 11:46:19 +0000
commit7eb0a763c32c9887dd0b1523ac154757f641e27e (patch)
tree41857f1f67db27f59f4ea3628eeca810113a8ee9
parente4d08143bb6c246bf33cc6407bb61c5f3ce18391 (diff)
downloadrsyslog-7eb0a763c32c9887dd0b1523ac154757f641e27e.tar.gz
rsyslog-7eb0a763c32c9887dd0b1523ac154757f641e27e.tar.xz
rsyslog-7eb0a763c32c9887dd0b1523ac154757f641e27e.zip
fixed a bug in integer conversion
-rwxr-xr-xsrUtils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/srUtils.c b/srUtils.c
index acd8edd9..9dcea299 100755
--- a/srUtils.c
+++ b/srUtils.c
@@ -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 */