diff options
author | wlestes <wlestes> | 2002-09-11 21:22:05 +0000 |
---|---|---|
committer | wlestes <wlestes> | 2002-09-11 21:22:05 +0000 |
commit | 94bcd90f95f707816c96b748b82112fd86cda6a2 (patch) | |
tree | 3497a9ef81f8b19ce4a9055913b0240b172e695b /scan.l | |
parent | 73a57a642914964e9ce8ec785be47308ecf0ae84 (diff) | |
download | flex-94bcd90f95f707816c96b748b82112fd86cda6a2.tar.gz |
the debian patch used strlen(yytext) and similar constructs--as millaway points out, this is better known as yyleng
Diffstat (limited to 'scan.l')
-rw-r--r-- | scan.l | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -53,7 +53,7 @@ extern bool tablesverify, tablesext; return CHAR; #define RETURNNAME \ - if(strlen(yytext) < MAXLINE) \ + if(yyleng < MAXLINE) \ { \ strcpy( nmstr, yytext ); \ } \ @@ -154,7 +154,7 @@ LEXOPT [aceknopr] ^"%"[^sxaceknopr{}].* synerr( _( "unrecognized '%' directive" ) ); ^{NAME} { - if(strlen(yytext) < MAXLINE) + if(yyleng < MAXLINE) { strcpy( nmstr, yytext ); } @@ -211,7 +211,7 @@ LEXOPT [aceknopr] {WS} /* separates name and definition */ {NOT_WS}[^\r\n]* { - if(strlen(yytext) < MAXLINE) + if(yyleng < MAXLINE) { strcpy( (char *) nmdef, yytext ); } @@ -350,7 +350,7 @@ LEXOPT [aceknopr] \"[^"\n]*\" { - if(strlen(yytext + 1 ) < MAXLINE) + if(yyleng-1 < MAXLINE) { strcpy( nmstr, yytext + 1 ); } @@ -489,7 +489,7 @@ LEXOPT [aceknopr] "["({FIRST_CCL_CHAR}|{CCL_EXPR})({CCL_CHAR}|{CCL_EXPR})* { int cclval; - if(strlen(yytext ) < MAXLINE) + if(yyleng < MAXLINE) { strcpy( nmstr, yytext ); } @@ -539,7 +539,7 @@ LEXOPT [aceknopr] end_ch = yytext[yyleng-1]; end_is_ws = end_ch != '}' ? 1 : 0; - if(strlen(yytext + 1 ) < MAXLINE) + if(yyleng-1 < MAXLINE) { strcpy( nmstr, yytext + 1 ); } |