[hackers] [st] Introduce lim in all ttywrite() checks. || Christoph Lohmann
commit 00873e65eed161ee5f8916fbfb25c1a7f7a9b2f8
Author: Christoph Lohmann <20h_AT_r-36.net>
AuthorDate: Fri Nov 6 20:46:23 2015 +0100
Commit: Christoph Lohmann <20h_AT_r-36.net>
CommitDate: Fri Nov 6 20:46:23 2015 +0100
Introduce lim in all ttywrite() checks.
diff --git a/st.c b/st.c
index 900534b..a47f094 100644
--- a/st.c
+++ b/st.c
_AT_@ -1522,11 +1522,11 @@ ttywrite(const char *s, size_t n)
lim = ttyread();
if (FD_ISSET(cmdfd, &wfd)) {
/*
- * Only write 256 bytes at maximum. This seems to be a
- * reasonable value for a serial line. Bigger values
- * might clog the I/O.
+ * Only write the bytes written by ttywrite() or the
+ * default of 256. This seems to be a reasonable value
+ * for a serial line. Bigger values might clog the I/O.
*/
- if ((r = write(cmdfd, s, (n < 256)? n : 256)) < 0)
+ if ((r = write(cmdfd, s, (n < lim)? n : lim)) < 0)
goto write_error;
if (r < n) {
/*
Received on Fri Nov 06 2015 - 20:46:57 CET
This archive was generated by hypermail 2.3.0
: Fri Nov 06 2015 - 20:48:12 CET