From 94bcd90f95f707816c96b748b82112fd86cda6a2 Mon Sep 17 00:00:00 2001 From: wlestes Date: Wed, 11 Sep 2002 21:22:05 +0000 Subject: the debian patch used strlen(yytext) and similar constructs--as millaway points out, this is better known as yyleng --- scan.l | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scan.l') diff --git a/scan.l b/scan.l index 930fcb0..31d93ef 100644 --- a/scan.l +++ b/scan.l @@ -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 ); } -- cgit v1.2.1