b64/output.c
Eric 733a013ee7 remove bugs related to uninitialized variables
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.
2025-05-28 17:31:07 +02:00

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;
}