From d0d647b965c1e257bf8baf2a890eab957950bb3e Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 7 Dec 2010 00:21:42 +0000 Subject: [PATCH] More sensible (and also more idiomatic) bounds checking on esc_args. [originally from svn r9027] --- terminal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terminal.c b/terminal.c index c0c809c6..ba504d43 100644 --- a/terminal.c +++ b/terminal.c @@ -3290,8 +3290,8 @@ static void term_out(Terminal *term) } term->termstate = SEEN_CSI; } else if (c == ';') { - if (++term->esc_nargs <= ARGS_MAX) - term->esc_args[term->esc_nargs - 1] = ARG_DEFAULT; + if (term->esc_nargs < ARGS_MAX) + term->esc_args[term->esc_nargs++] = ARG_DEFAULT; term->termstate = SEEN_CSI; } else if (c < '@') { if (term->esc_query) -- 2.45.2