[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: base64, encoding and tests
From: |
Sergey Poznyakoff |
Subject: |
Re: base64, encoding and tests |
Date: |
Wed, 27 Nov 2002 01:44:19 +0200 |
> Sure. With the attached file, try to encode a file that contains, for
> instance, the bytes 0 to 255. I obtain a truncated encoded file (7
> bytes missing if I remember correctly). The problem seems to be in
> filter_trans.c, trans_read ().
I see now. The trans_read() exits if it cannot read any more bytes
from the underlying stream even though it still has some unprocessed
data in its buffer. I guess the attached patch fixes the bug.
Does it work for you?
Regards,
Sergey
Index: mailbox/filter_trans.c
===================================================================
RCS file: /cvsroot/mailutils/mailutils/mailbox/filter_trans.c,v
retrieving revision 1.5
diff -p -u -w -b -r1.5 filter_trans.c
--- mailbox/filter_trans.c 25 Mar 2002 03:46:11 -0000 1.5
+++ mailbox/filter_trans.c 26 Nov 2002 23:34:36 -0000
@@ -163,7 +163,7 @@ trans_read (filter_t filter, char *optr,
ret = stream_read (filter->stream, ts->w_buf + ts->w_whd,
MU_TRANS_BSIZE - ts->w_whd, ts->offset,
&wbytes );
- if (ret != 0 || wbytes == 0)
+ if (ret != 0)
break;
ts->offset += wbytes;
ts->w_whd += wbytes;
- base64, encoding and tests, Frederic Gobry, 2002/11/26
- Re: base64, encoding and tests, Sergey Poznyakoff, 2002/11/26
- Re: base64, encoding and tests, Frederic Gobry, 2002/11/26
- Re: base64, encoding and tests, Frederic Gobry, 2002/11/26
- Re: base64, encoding and tests,
Sergey Poznyakoff <=
- Re: base64, encoding and tests, Frederic Gobry, 2002/11/27
- Re: base64, encoding and tests, Sergey Poznyakoff, 2002/11/27