diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-30 10:53:46 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-30 10:53:46 +0000 |
commit | 27fd3e6a6743421739e5ab920b0d40cb00062180 (patch) | |
tree | 1ef7f2807a52f25fac6044b94c573a102d9ec065 /usr.bin/lex/initscan.c | |
parent | 3b3586c30c70241fc6f182df78a91d7ebed6ddac (diff) |
use strlcpy and snprintf
Diffstat (limited to 'usr.bin/lex/initscan.c')
-rw-r--r-- | usr.bin/lex/initscan.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/lex/initscan.c b/usr.bin/lex/initscan.c index 9d33e2a50df..47a25c0d6b4 100644 --- a/usr.bin/lex/initscan.c +++ b/usr.bin/lex/initscan.c @@ -1,10 +1,10 @@ -/* $OpenBSD: initscan.c,v 1.6 2001/11/19 19:02:14 mpech Exp $ */ +/* $OpenBSD: initscan.c,v 1.7 2002/05/30 10:53:44 deraadt Exp $ */ #line 2 "scan.c" /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvs/OpenBSD/src/usr.bin/lex/initscan.c,v 1.6 2001/11/19 19:02:14 mpech Exp $ + * $Header: /cvs/OpenBSD/src/usr.bin/lex/initscan.c,v 1.7 2002/05/30 10:53:44 deraadt Exp $ */ #define FLEX_SCANNER @@ -1272,7 +1272,7 @@ char *yytext; * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -/* $Header: /cvs/OpenBSD/src/usr.bin/lex/initscan.c,v 1.6 2001/11/19 19:02:14 mpech Exp $ */ +/* $Header: /cvs/OpenBSD/src/usr.bin/lex/initscan.c,v 1.7 2002/05/30 10:53:44 deraadt Exp $ */ #include "flexdef.h" #include "parse.h" @@ -1294,7 +1294,7 @@ char *yytext; return CHAR; #define RETURNNAME \ - strcpy( nmstr, yytext ); \ + strlcpy( nmstr, yytext, sizeof nmstr ); \ return NAME; #define PUT_BACK_STRING(str, start) \ @@ -1667,7 +1667,7 @@ case 15: YY_RULE_SETUP #line 138 "scan.l" { - strcpy( nmstr, yytext ); + strlcpy( nmstr, yytext, sizeof nmstr ); didadef = false; BEGIN(PICKUPDEF); } @@ -1768,7 +1768,7 @@ case 31: YY_RULE_SETUP #line 186 "scan.l" { - strcpy( (char *) nmdef, yytext ); + strlcpy( (char *) nmdef, yytext, sizeof nmdef ); /* Skip trailing whitespace. */ for ( i = strlen( (char *) nmdef ) - 1; @@ -2046,7 +2046,7 @@ case 80: YY_RULE_SETUP #line 279 "scan.l" { - strcpy( nmstr, yytext + 1 ); + strlcpy( nmstr, yytext + 1, sizeof nmstr ); nmstr[strlen( nmstr ) - 1] = '\0'; return NAME; } @@ -2257,7 +2257,7 @@ YY_RULE_SETUP { int cclval; - strcpy( nmstr, yytext ); + strlcpy( nmstr, yytext, sizeof nmstr ); /* Check to see if we've already encountered this * ccl. @@ -2295,7 +2295,7 @@ YY_RULE_SETUP Char *nmdefptr; Char *ndlookup(); - strcpy( nmstr, yytext + 1 ); + strlcpy( nmstr, yytext + 1, sizeof nmstr ); nmstr[yyleng - 2] = '\0'; /* chop trailing brace */ if ( (nmdefptr = ndlookup( nmstr )) == 0 ) |