summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-01-15 15:36:15 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-01-15 15:36:15 +0100
commit123143d0f1f5e99b04f963c5d785a8f8918decdc (patch)
treea4ef8814398e555bc6112f94877c7a7544a9b432
parent9273b4bb4dcb6683cf6825fedd3cb5cd0f59805a (diff)
downloadrsyslog-123143d0f1f5e99b04f963c5d785a8f8918decdc.tar.gz
rsyslog-123143d0f1f5e99b04f963c5d785a8f8918decdc.tar.bz2
rsyslog-123143d0f1f5e99b04f963c5d785a8f8918decdc.zip
optimize: another round of removing isdigit()
-rw-r--r--tcps_sess.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tcps_sess.c b/tcps_sess.c
index 16fd94f5..523f2b9e 100644
--- a/tcps_sess.c
+++ b/tcps_sess.c
@@ -362,7 +362,7 @@ processDataRcvd(tcps_sess_t *pThis, char c, struct syslogTime *stTime, time_t tt
ISOBJ_TYPE_assert(pThis, tcps_sess);
if(pThis->inputState == eAtStrtFram) {
- if(pThis->bSuppOctetFram && isdigit((int) c)) {
+ if(pThis->bSuppOctetFram && c >= '0' && c <= '9') {
pThis->inputState = eInOctetCnt;
pThis->iOctetsRemain = 0;
pThis->eFraming = TCP_FRAMING_OCTET_COUNTING;
@@ -373,7 +373,7 @@ processDataRcvd(tcps_sess_t *pThis, char c, struct syslogTime *stTime, time_t tt
}
if(pThis->inputState == eInOctetCnt) {
- if(isdigit(c)) {
+ if(c >= '0' && c <= '9') { /* isdigit() the faster way */
pThis->iOctetsRemain = pThis->iOctetsRemain * 10 + c - '0';
} else { /* done with the octet count, so this must be the SP terminator */
DBGPRINTF("TCP Message with octet-counter, size %d.\n", pThis->iOctetsRemain);