summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-08-13 23:47:58 -0400
committerJune McEnroe <june@causal.agency>2019-08-13 23:47:58 -0400
commit360174e3cf235b796292267533541e1a7dafcd18 (patch)
tree1e146464cbec1593cd09ca458c4ebd5f43b260af
parentBox ICH and DCH to R-X (diff)
downloadstream-360174e3cf235b796292267533541e1a7dafcd18.tar.gz
stream-360174e3cf235b796292267533541e1a7dafcd18.zip
Stop parsing CSI params when cap is hit
Diffstat (limited to '')
-rw-r--r--term.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/term.c b/term.c
index 954ef32..09fe4fa 100644
--- a/term.c
+++ b/term.c
@@ -110,10 +110,9 @@ ACTION(csi) {
 static void csiParam(struct Term *t, wchar_t ch) {
 	if (ch == L'?') {
 		t->param.q = true;
-	} else if (ch == L';') {
+	} else if (ch == L';' && t->param.n < ParamCap) {
 		t->param.n++;
 		t->param.i++;
-		t->param.i %= ParamCap;
 	} else if (ch >= L'0' && ch <= L'9') {
 		t->param.s[t->param.i] *= 10;
 		t->param.s[t->param.i] += ch - L'0';