diff options
author | Christoph Lohmann <20h@r-36.net> | 2015-11-06 20:46:23 +0100 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2015-11-06 20:46:23 +0100 |
commit | 00873e65eed161ee5f8916fbfb25c1a7f7a9b2f8 (patch) | |
tree | f03dc088eb8d028c2bc560caec9e6a5136781c4d /st.c | |
parent | 9f6d8845df3f81e2bc86f593a2f93e098422b2fa (diff) | |
download | st-00873e65eed161ee5f8916fbfb25c1a7f7a9b2f8.tar.gz st-00873e65eed161ee5f8916fbfb25c1a7f7a9b2f8.tar.bz2 |
Introduce lim in all ttywrite() checks.
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) { /* |