aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/termptyesc.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2017-05-17 23:40:19 +0200
committerBoris Faure <billiob@gmail.com>2017-05-17 23:40:19 +0200
commit7b5a9b74bc86554629030bf25caacff90bdb343e (patch)
tree1ba986e7595420ed9d100d3b78f538e0fcf4e35e /src/bin/termptyesc.c
parenttermptyesc: _csi_arg_get() could be called with nothing to read (diff)
downloadterminology-7b5a9b74bc86554629030bf25caacff90bdb343e.tar.gz
termptyesc: use macro to restrict field value
Diffstat (limited to 'src/bin/termptyesc.c')
-rw-r--r--src/bin/termptyesc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 30c9df6..918e9af 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -766,8 +766,7 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
break;
case '@': // insert N blank chars
arg = _csi_arg_get(&b);
- if (arg < 1) arg = 1;
- if (arg > ty->w * ty->h) arg = ty->w * ty->h;
+ TERMPTY_RESTRICT_FIELD(ty->cursor_state.cx, 1, ty->w * ty->h);
DBG("insert %d blank chars", arg);
{
int pi = ty->termstate.insert;