These bugs became visible when using optimization options. They were either not present unoptimized or very unlikely to occur. However, given the options, the resulting program would behave incorrectly and reliably break under all circumstances. The makefile will see the intended changes accordingly in the following commit to ensure compatibility.
20 lines
295 B
C
20 lines
295 B
C
#include "output.h"
|
|
|
|
#define WRAPCOL 76
|
|
|
|
char
|
|
printw(FILE *fp, unsigned char *s, int slen)
|
|
{
|
|
static int col;
|
|
int c;
|
|
|
|
c = '\n';
|
|
while (slen--) {
|
|
fputc((c = *s++), fp);
|
|
++col;
|
|
if (!(col %= WRAPCOL))
|
|
fputc((c = '\n'), fp);
|
|
}
|
|
|
|
return c;
|
|
}
|