summaryrefslogtreecommitdiff
path: root/scan.l
diff options
context:
space:
mode:
authorwlestes <wlestes>2002-09-11 21:22:05 +0000
committerwlestes <wlestes>2002-09-11 21:22:05 +0000
commit94bcd90f95f707816c96b748b82112fd86cda6a2 (patch)
tree3497a9ef81f8b19ce4a9055913b0240b172e695b /scan.l
parent73a57a642914964e9ce8ec785be47308ecf0ae84 (diff)
downloadflex-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.l12
1 files changed, 6 insertions, 6 deletions
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 );
}