Andy.Linton@comp.vuw.ac.nz (Andy Linton) (11/02/90)
I suspect not too many people will be bitten by this problem but I'll
give the details for those who are.
Description:
Blank lines in messages are duplicated.
Repeat-By:
Send mail with embedded blank lines from a MOREbsd HP300 system running
5.65+IDA
Fix:
Problem arises because putline() in util.c exercises a bug in fprintf()
in the standard C library. We have notified Mt Xinu and passed a patch
to them. The problem with fprintf() arises because putline() uses the
following format string:
fprintf(fp, "%.*s%s", p-l, l, m->m_eol);
When a blank line is to be printed 'p-l' evaluates to '0' and the bug in
fprintf() prints the string 'l' (which in this case contains '\n') in a
field 32767 wide instead of using one which is of zero width.
Subsequent code in putline() prints out another '\n' giving the
duplicate blank line.
The real fix is to replace fprintf() in the standard C library but use
of the putline() version from 5.64 should be possible as a stop gap
measure.
You can test your fprint() for this problem using:
#include <stdio.h>
main()
{
fprintf(stdout, "fprintf() %.0s%s\n", "not ", "correct");
}
The output should say it all!