Fix an off-by-one bug which caused the last byte written to be lost if there was a CR or LF in the array, and fix a bug where long lines were not properly split. Index: RFC2822OutputStream.java =================================================================== RCS file: /cvs/rhug/rhug/classpathx-mail/upstream/source/gnu/mail/util/RFC2822OutputStream.java,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 RFC2822OutputStream.java --- upstream/source/gnu/mail/util/RFC2822OutputStream.java 15 Oct 2003 15:39:48 -0000 1.1.1.1 +++ upstream/source/gnu/mail/util/RFC2822OutputStream.java 23 Oct 2003 15:13:15 -0000 @@ -117,17 +117,17 @@ count++; if (b[i]==CR || b[i]==LF) { - out.write(b, d, i-d); - d = i; + out.write(b, d, i+1-d); + d = i + 1; count = 0; } else { if (count>998) { - out.write(LF); out.write(b, d, count); - d = i; + out.write(LF); + d = i + 1; count = 0; } }