repair line wrap bug

A new line is wrongfully added to empty input when using the line wrap
option.
This commit is contained in:
Eric 2025-05-30 13:28:47 +02:00
parent aacf2324c7
commit 06b8c2a046

2
main.c
View file

@ -58,7 +58,7 @@ main(int argc, char *argv[])
fwrite(obuf, sizeof(*obuf), n, (out) ? out : stdout);
}
} else if (wrp) {
last = 0;
last = '\n';
while ((n = fread(obuf, sizeof(*obuf), OCTETBUF, (in) ? in : stdin))) {
n = encode(obuf, n, sbuf, url);
last = printw((out) ? out : stdout, sbuf, n);