add linewrap option when encoding (76 columns)
This commit is contained in:
parent
6c7d699f1a
commit
0dba01d98e
4 changed files with 46 additions and 6 deletions
19
output.c
Normal file
19
output.c
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue