From df8f1be5c9606494f436a867cf786c1793cf9147 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 31 Mar 2011 12:49:13 -0400 Subject: [PATCH] Avoid using pre or post increment in a parameter to a ctype(3) function as it might be a macro that causes the increment to happen more than once. --HG-- branch : 1.7 --- toke.c | 6 +++--- toke.l | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toke.c b/toke.c index f6e8b8879..f7ae580d0 100644 --- 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 ee56a6d04..731637963 100644 --- 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) { -- 2.40.0