add linewrap option when encoding (76 columns)

This commit is contained in:
Eric 2025-05-27 01:32:09 +02:00
parent 6c7d699f1a
commit 0dba01d98e
4 changed files with 46 additions and 6 deletions

19
output.c Normal file
View file

@ -0,0 +1,19 @@
#include "output.h"
#define WRAPCOL 76
char
printw(FILE *fp, unsigned char *s, int slen)
{
static int col;
int c;
while (slen--) {
fputc((c = *s++), fp);
++col;
if (!(col %= WRAPCOL))
fputc((c = '\n'), fp);
}
return c;
}