]> granicus.if.org Git - sudo/commitdiff
regen
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 15 Mar 2003 01:11:51 +0000 (01:11 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 15 Mar 2003 01:11:51 +0000 (01:11 +0000)
lex.yy.c

index 122d593536df2d8375d340342b40e35f03fb1d2c..21a8916245ab2005f23d1c0ef92a974af24fd8bf 100644 (file)
--- a/lex.yy.c
+++ b/lex.yy.c
@@ -2500,15 +2500,14 @@ fill_cmnd(s, len)
 {
     arg_len = arg_size = 0;
 
-    yylval.command.cmnd = (char *) malloc(len + 1);
+    yylval.command.cmnd = (char *) malloc(++len);
     if (yylval.command.cmnd == NULL) {
        yyerror("unable to allocate memory");
        return;
     }
 
     /* copy the string and NULL-terminate it (escapes handled by fnmatch) */
-    (void) strncpy(yylval.command.cmnd, s, len);
-    yylval.command.cmnd[len] = '\0';
+    (void) strlcpy(yylval.command.cmnd, s, len);
 
     yylval.command.args = NULL;
 }