diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-19 16:07:17 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-19 16:07:17 +0200 |
commit | 3abf567d2b57014381eda49018a0e2c21fa1b853 (patch) | |
tree | 6329a682041da705a363efd842740ed8c025b848 /runtime/datetime.c | |
parent | 953d015f440224321796105464294006838b5302 (diff) | |
download | rsyslog-3abf567d2b57014381eda49018a0e2c21fa1b853.tar.gz rsyslog-3abf567d2b57014381eda49018a0e2c21fa1b853.tar.xz rsyslog-3abf567d2b57014381eda49018a0e2c21fa1b853.zip |
optimized template string generation
Diffstat (limited to 'runtime/datetime.c')
-rw-r--r-- | runtime/datetime.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/datetime.c b/runtime/datetime.c index b5514e7c..8f4bfa10 100644 --- a/runtime/datetime.c +++ b/runtime/datetime.c @@ -556,7 +556,7 @@ int formatTimestampToMySQL(struct syslogTime *ts, char* pBuf, size_t iLenDst) */ assert(ts != NULL); assert(pBuf != NULL); - assert(iLenDst < 15); + assert(iLenDst >= 15); pBuf[0] = (ts->year / 1000) % 10 + '0'; pBuf[1] = (ts->year / 100) % 10 + '0'; @@ -582,7 +582,7 @@ int formatTimestampToPgSQL(struct syslogTime *ts, char *pBuf, size_t iLenDst) /* see note in formatTimestampToMySQL, applies here as well */ assert(ts != NULL); assert(pBuf != NULL); - assert(iLenDst < 20); + assert(iLenDst >= 20); pBuf[0] = (ts->year / 1000) % 10 + '0'; pBuf[1] = (ts->year / 100) % 10 + '0'; @@ -666,7 +666,7 @@ int formatTimestamp3339(struct syslogTime *ts, char* pBuf, size_t iLenBuf) BEGINfunc assert(ts != NULL); assert(pBuf != NULL); - assert(iLenBuf < 33); + assert(iLenBuf >= 33); /* start with fixed parts */ /* year yyyy */ @@ -741,7 +741,7 @@ int formatTimestamp3164(struct syslogTime *ts, char* pBuf, size_t iLenBuf) assert(ts != NULL); assert(pBuf != NULL); - assert(iLenBuf < 16); + assert(iLenBuf >= 16); pBuf[0] = monthNames[(ts->month - 1)% 12][0]; pBuf[1] = monthNames[(ts->month - 1) % 12][1]; |