aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2019-10-16 12:19:49 +0300
committerHiltjo Posthuma <hiltjo@codemadness.org>2019-11-10 22:45:54 +0100
commit7ceb3d1f72eabfa678e5cfae176c57630ad98c43 (patch)
treeda9a6a0aa783b17ce0fa62891210ab36015e51d5 /st.c
parentea4d933ed9d8ce16699c84892a29e070c70b2eb9 (diff)
downloadst-patched-7ceb3d1f72eabfa678e5cfae176c57630ad98c43.tar.bz2
st-patched-7ceb3d1f72eabfa678e5cfae176c57630ad98c43.tar.xz
st-patched-7ceb3d1f72eabfa678e5cfae176c57630ad98c43.zip
STREscape: don't trim prematurely
STRescape holds strings in escape sequences such as OSC and DCS, and its buffer is 512 bytes. If the input is too big then trailing chars are ignored, but the test was off-by-1 such that it took 510 chars instead of 511 (before a terminating NULL is added). Now the full size can be utilized.
Diffstat (limited to 'st.c')
-rw-r--r--st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/st.c b/st.c
index a8f8232..50226d1 100644
--- a/st.c
+++ b/st.c
@@ -2330,7 +2330,7 @@ tputc(Rune u)
2330 if (term.esc&ESC_DCS && strescseq.len == 0 && u == 'q') 2330 if (term.esc&ESC_DCS && strescseq.len == 0 && u == 'q')
2331 term.mode |= MODE_SIXEL; 2331 term.mode |= MODE_SIXEL;
2332 2332
2333 if (strescseq.len+len >= sizeof(strescseq.buf)-1) { 2333 if (strescseq.len+len >= sizeof(strescseq.buf)) {
2334 /* 2334 /*
2335 * Here is a bug in terminals. If the user never sends 2335 * Here is a bug in terminals. If the user never sends
2336 * some code to stop the str or esc command, then st 2336 * some code to stop the str or esc command, then st