sfeed

simple feed reader - forked from git.codemadness.org/sfeed
git clone git://src.gearsix.net/sfeed
Log | Files | Refs | Atom | README | LICENSE

commit 813a96b517ae96716fb018ff93ab2d6a4bbcda95
parent b6f7a3fe15f2f253a1653454f514b467aa20f821
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Mon, 14 Mar 2022 14:07:20 +0100

sfeed_curses: use ttywrite() for writing to the tty consistently

This should also suppress a compiler warning of an unchecked write() return
value.

Diffstat:
Msfeed_curses.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sfeed_curses.c b/sfeed_curses.c @@ -986,7 +986,7 @@ lineeditor(void) int ch; for (;;) { - if (nchars + 1 >= cap) { + if (nchars + 2 >= cap) { cap = cap ? cap * 2 : 32; input = erealloc(input, cap); } @@ -999,11 +999,11 @@ lineeditor(void) if (!nchars) continue; input[--nchars] = '\0'; - write(1, "\b \b", 3); /* back, blank, back */ - continue; + ttywrite("\b \b"); /* back, blank, back */ } else if (ch >= ' ') { input[nchars] = ch; - write(1, &input[nchars], 1); + input[nchars + 1] = '\0'; + ttywrite(&input[nchars]); nchars++; } else if (ch < 0) { switch (sigstate) {