aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Halachmi (:avih)2019-10-16 12:19:49 +0300
committerHiltjo Posthuma2019-11-10 22:45:54 +0100
commit246a611028d44bd176dd4397343d4e4f2d1af607 (patch)
tree9cd980166f614d9d127ebbb90c5e1d98c519f56d
parentfc72363ece06313165c836698053d55ce94d6722 (diff)
downloadaur-246a611028d44bd176dd4397343d4e4f2d1af607.tar.gz
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.
-rw-r--r--st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/st.c b/st.c
index a8f8232e3539..50226d1677b2 100644
--- a/st.c
+++ b/st.c
@@ -2330,7 +2330,7 @@ tputc(Rune u)
if (term.esc&ESC_DCS && strescseq.len == 0 && u == 'q')
term.mode |= MODE_SIXEL;
- if (strescseq.len+len >= sizeof(strescseq.buf)-1) {
+ if (strescseq.len+len >= sizeof(strescseq.buf)) {
/*
* Here is a bug in terminals. If the user never sends
* some code to stop the str or esc command, then st