]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/commitdiff
More sensible (and also more idiomatic) bounds checking on esc_args.
authorSimon Tatham <anakin@pobox.com>
Tue, 7 Dec 2010 00:21:42 +0000 (00:21 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 7 Dec 2010 00:21:42 +0000 (00:21 +0000)
git-svn-id: http://svn.tartarus.org/sgt/putty@9027 cda61777-01e9-0310-a592-d414129be87e

terminal.c

index c0c809c6c7751326b21bed9b4664885461ac7da3..ba504d439bfe9d90998a378d471a73a990428fc9 100644 (file)
@@ -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)