Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/flex/dist/src Apply our changes dropped in prev...



details:   https://anonhg.NetBSD.org/src/rev/6973370af23c
branches:  trunk
changeset: 344233:6973370af23c
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Thu Mar 17 15:23:21 2016 +0000

description:
Apply our changes dropped in previous merge.

diffstat:

 external/bsd/flex/dist/src/scan.l |  23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diffs (95 lines):

diff -r 77a2ffbfb03a -r 6973370af23c external/bsd/flex/dist/src/scan.l
--- a/external/bsd/flex/dist/src/scan.l Thu Mar 17 13:59:02 2016 +0000
+++ b/external/bsd/flex/dist/src/scan.l Thu Mar 17 15:23:21 2016 +0000
@@ -1,3 +1,5 @@
+/*     $NetBSD: scan.l,v 1.4 2016/03/17 15:23:21 nakayama Exp $        */
+
 /* scan.l - scanner for flex input -*-C-*- */
 
 %{
@@ -31,8 +33,9 @@
 /*  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
 /*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
 /*  PURPOSE. */
+#include "flexdef.h"
+__RCSID("$NetBSD: scan.l,v 1.4 2016/03/17 15:23:21 nakayama Exp $");
 
-#include "flexdef.h"
 #include "parse.h"
 extern bool tablesverify, tablesext;
 extern int trlcontxt; /* Set in  parse.y for each rule. */
@@ -68,7 +71,7 @@
 #define RETURNNAME \
        if(yyleng < MAXLINE) \
          { \
-       strcpy( nmstr, yytext ); \
+       strlcpy( nmstr, yytext, sizeof(nmstr) ); \
         } \
        else \
         { \
@@ -81,9 +84,9 @@
        for ( i = strlen( str ) - 1; i >= start; --i ) \
                unput((str)[i])
 
-#define CHECK_REJECT(str) \
+#define CHECK_RE_JECT(str) \
        if ( all_upper( str ) ) \
-               reject = true;
+               reject = true
 
 #define CHECK_YYMORE(str) \
        if ( all_lower( str ) ) \
@@ -185,7 +188,7 @@
        ^{NAME}         {
                        if(yyleng < MAXLINE)
                         {
-                       strcpy( nmstr, yytext );
+                       strlcpy( nmstr, yytext, sizeof(nmstr) );
                         }
                        else
                         {
@@ -293,7 +296,7 @@
        {NOT_WS}[^\r\n]*        {
                        if(yyleng < MAXLINE)
                         {
-                       strcpy( (char *) nmdef, yytext );
+                       strlcpy( (char *) nmdef, yytext, sizeof(nmdef) );
                         }
                        else
                         {
@@ -436,7 +439,7 @@
        \"[^"\n]*\"     {
                        if(yyleng-1 < MAXLINE)
                         {
-                       strcpy( nmstr, yytext + 1 );
+                       strlcpy( nmstr, yytext + 1, sizeof(nmstr) );
                         }
                        else
                         {
@@ -611,7 +614,7 @@
 
                        if(yyleng < MAXLINE)
                         {
-                       strcpy( nmstr, yytext );
+                       strlcpy( nmstr, yytext, sizeof(nmstr) );
                         }
                        else
                         {
@@ -669,7 +672,7 @@
 
                        if(yyleng-1 < MAXLINE)
                         {
-                       strcpy( nmstr, yytext + 1 );
+                       strlcpy( nmstr, yytext + 1, sizeof(nmstr) );
                         }
                        else
                         {
@@ -875,7 +878,7 @@
        <CODEBLOCK,ACTION>{
                "reject"        {
                        ACTION_ECHO;
-                       CHECK_REJECT(yytext);
+                       CHECK_RE_JECT(yytext);
                        }
                "yymore"        {
                        ACTION_ECHO;



Home | Main Index | Thread Index | Old Index