diff options
author | June McEnroe <june@causal.agency> | 2019-08-14 16:00:12 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-08-14 16:00:12 -0400 |
commit | 0efc0610f3c34fbe7d5a66a2bcb3220bada08a47 (patch) | |
tree | 44fce6d3c545df52e18f7481577f95650cb068a2 | |
parent | Fix wrapping, maybe? (diff) | |
download | stream-0efc0610f3c34fbe7d5a66a2bcb3220bada08a47.tar.gz stream-0efc0610f3c34fbe7d5a66a2bcb3220bada08a47.zip |
Behave like ICH in IRM
This should fix another OOB bug.
-rw-r--r-- | term.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/term.c b/term.c index 178e613..a7e53bf 100644 --- a/term.c +++ b/term.c @@ -328,7 +328,8 @@ ACTION(add) { } if (t->mode & Insert) { - move(C(Y, X + width), C(Y, X), t->cols - X - width); + uint n = MIN((uint)width, t->cols - X); + move(C(Y, X + n), C(Y, X), t->cols - X - n); } if (t->mode & Wrap && X + width > t->cols) { cr(t, ch); |