summaryrefslogtreecommitdiff
path: root/pipe.c
diff options
context:
space:
mode:
authoraaron <aaron@7b491191-dbf0-0310-aff6-d879d4d69008>2004-05-04 00:22:35 +0000
committeraaron <aaron@7b491191-dbf0-0310-aff6-d879d4d69008>2004-05-04 00:22:35 +0000
commit48b5c2dd5cffaa1fb58c789d19720176a6811318 (patch)
tree036e3089e1dadd597ca85bf8aa3c5f9d7e697aeb /pipe.c
parent54e8bbf237e4d2dab7fca04bb8e857da934ed829 (diff)
Added a ring buffer to help find the end-of-message sequence
git-svn-id: https://svn.ic-s.nl/svn/dbmail/trunk/dbmail@1116 7b491191-dbf0-0310-aff6-d879d4d69008
Diffstat (limited to 'pipe.c')
-rw-r--r--pipe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pipe.c b/pipe.c
index ccd68177..d8248f24 100644
--- a/pipe.c
+++ b/pipe.c
@@ -467,7 +467,10 @@ static int store_message_temp(FILE * instream,
&& ringbuf[(ringpos - 5) % RING_SIZE] == '\r') {
/* Back off the trailing "\r\n.\r" (last \n not copied yet)
* and set the myeof flag, stopping this loop. */
- usedmem -= 4;
+ if (usedmem > 4)
+ usedmem -= 4;
+ else
+ usedmem = 0;
myeof = 1;
} else {
/* Copy the current character into the storage buffer. */