]> granicus.if.org Git - sudo/commitdiff
Avoid using pre or post increment in a parameter to a ctype(3)
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 31 Mar 2011 16:49:13 +0000 (12:49 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 31 Mar 2011 16:49:13 +0000 (12:49 -0400)
function as it might be a macro that causes the increment to happen
more than once.

--HG--
branch : 1.7

toke.c
toke.l

diff --git a/toke.c b/toke.c
index f6e8b8879b416f75b2340945cfcd323cdbdfb7dd..f7ae580d0fc8d417b8640b9beae7cb68cbc668f4 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1993,9 +1993,9 @@ YY_RULE_SETUP
                            for (n = 0; isblank((unsigned char)yytext[n]); n++)
                                continue;
                            n += sizeof("Defaults") - 1;
-                           if ((deftype = yytext[n]) != '\0') {
-                               while (isblank((unsigned char)yytext[++n]))
-                                   continue;
+                           if ((deftype = yytext[n++]) != '\0') {
+                               while (isblank((unsigned char)yytext[n]))
+                                   n++;
                            }
                            BEGIN GOTDEFS;
                            switch (deftype) {
diff --git a/toke.l b/toke.l
index ee56a6d04f7f99dad1fd410711ce5e8b7a8ed398..7316379638d543c0896eca939e66978ad6ff650b 100644 (file)
--- a/toke.l
+++ b/toke.l
@@ -303,9 +303,9 @@ DEFVAR                      [a-z_]+
                            for (n = 0; isblank((unsigned char)yytext[n]); n++)
                                continue;
                            n += sizeof("Defaults") - 1;
-                           if ((deftype = yytext[n]) != '\0') {
-                               while (isblank((unsigned char)yytext[++n]))
-                                   continue;
+                           if ((deftype = yytext[n++]) != '\0') {
+                               while (isblank((unsigned char)yytext[n]))
+                                   n++;
                            }
                            BEGIN GOTDEFS;
                            switch (deftype) {