From 162514b14ee6be0be792c0e66afd5f39b8b194c8 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 7 Dec 2010 00:21:42 +0000 Subject: [PATCH] More sensible (and also more idiomatic) bounds checking on esc_args. git-svn-id: svn://svn.tartarus.org/sgt/putty@9027 cda61777-01e9-0310-a592-d414129be87e --- 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.11.0