termptyesc: use macro to restrict field value

This commit is contained in:
Boris Faure 2017-05-17 23:40:19 +02:00
parent 490a065fb1
commit 7b5a9b74bc
1 changed files with 1 additions and 2 deletions

View File

@ -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;