X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/3ba6086fcf3dd298203e688309bbaafc6cadf0c9..926fce6aaacb525c10c864d4064b1cd086e0dd5a:/src/src/transport.c?ds=sidebyside diff --git a/src/src/transport.c b/src/src/transport.c index 8ccdd0389..a069b8833 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -1115,13 +1115,13 @@ DEBUG(D_transport) if (!(tctx->options & topt_no_body)) { - int size = size_limit; + unsigned long size = size_limit > 0 ? size_limit : ULONG_MAX; nl_check_length = abs(nl_check_length); nl_partial_match = 0; if (lseek(deliver_datafile, SPOOL_DATA_START_OFFSET, SEEK_SET) < 0) return FALSE; - while ( (len = MAX(DELIVER_IN_BUFFER_SIZE, size)) > 0 + while ( (len = MIN(DELIVER_IN_BUFFER_SIZE, size)) > 0 && (len = read(deliver_datafile, deliver_in_buffer, len)) > 0) { if (!write_chunk(tctx, deliver_in_buffer, len))