diff options
author | Christos Zoulas <christos@zoulas.com> | 2017-01-22 18:22:26 +0100 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2017-01-23 11:38:36 -0500 |
commit | 7ca76038dfa985f3f9560be53d775343cd1cf725 (patch) | |
tree | e0da18cc3f5e9fc7b936d073b615dbe0b40c183e | |
parent | f5d87f1a26f4a5c3402497008ae10e9a1345d327 (diff) |
scanner: Use strncpy
-rw-r--r-- | src/scan.l | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -74,7 +74,7 @@ extern const char *escaped_qstart, *escaped_qend; #define RETURNNAME \ if(yyleng < MAXLINE) \ { \ - strcpy( nmstr, yytext ); \ + strncpy( nmstr, yytext, sizeof(nmstr) ); \ return NAME; \ } \ else \ @@ -207,7 +207,7 @@ M4QEND "]""]" ^{NAME} { if(yyleng < MAXLINE) { - strcpy( nmstr, yytext ); + strncpy( nmstr, yytext, sizeof(nmstr) ); } else { @@ -318,7 +318,7 @@ M4QEND "]""]" {NOT_WS}[^\r\n]* { if(yyleng < MAXLINE) { - strcpy( nmdef, yytext ); + strncpy( nmdef, yytext, sizeof(nmdef) ); } else { @@ -460,7 +460,7 @@ M4QEND "]""]" \"[^"\n]*\" { if(yyleng-1 < MAXLINE) { - strcpy( nmstr, yytext + 1 ); + strncpy( nmstr, yytext + 1, sizeof(nmstr) ); } else { @@ -637,7 +637,7 @@ M4QEND "]""]" if(yyleng < MAXLINE) { - strcpy( nmstr, yytext ); + strncpy( nmstr, yytext, sizeof(nmstr) ); } else { @@ -695,7 +695,7 @@ M4QEND "]""]" if(yyleng-1 < MAXLINE) { - strcpy( nmstr, yytext + 1 ); + strncpy( nmstr, yytext + 1, sizeof(nmstr) ); } else { |