Xinqi Bao's Git
projects
/
st.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
9f6d884
)
Introduce lim in all ttywrite() checks.
author
Christoph Lohmann <
[email protected]
>
Fri, 6 Nov 2015 19:46:23 +0000
(20:46 +0100)
committer
Christoph Lohmann <
[email protected]
>
Fri, 6 Nov 2015 19:46:23 +0000
(20:46 +0100)
st.c
patch
|
blob
|
history
diff --git
a/st.c
b/st.c
index
900534b
..
a47f094
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-1522,11
+1522,11
@@
ttywrite(const char *s, size_t n)
lim = ttyread();
if (FD_ISSET(cmdfd, &wfd)) {
/*
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) {
/*
goto write_error;
if (r < n) {
/*