From 91ce6e89605b630a5ebc2644ecf70b0e810ecb26 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Thu, 1 Jun 2017 23:33:58 +0200 Subject: [PATCH] termptyesc: correctly handle missing arguments in CUP/HVP --- src/bin/termptyesc.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index b199bf56..5b016065 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -858,20 +858,13 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce) if (arg < 1) arg = 1; arg--; if (arg >= ty->h) arg = ty->h - 1; - if (b) - { - ty->cursor_state.cy = arg; - arg = _csi_arg_get(&b); - if (arg < 1) arg = 1; - arg--; - } - else arg = 0; + ty->cursor_state.cy = arg; + arg = _csi_arg_get(&b); + if (arg < 1) arg = 1; + arg--; if (arg >= ty->w) arg = ty->w - 1; - if (b) - { - ty->cursor_state.cx = arg; - } + ty->cursor_state.cx = arg; } TERMPTY_RESTRICT_FIELD(ty->cursor_state.cx, 0, ty->w); if (ty->termstate.restrict_cursor)