From 7b5a9b74bc86554629030bf25caacff90bdb343e Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Wed, 17 May 2017 23:40:19 +0200 Subject: [PATCH] termptyesc: use macro to restrict field value --- src/bin/termptyesc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index 30c9df65..918e9afc 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;