From 6fca0082ec4f3b34a0dabc78331bad8c22489dd2 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 10 Jul 2006 17:23:02 +0000 Subject: Convert some low hanging fruit to my_strlcpy/my_strlcat. p4raw-id: //depot/perl@28533 --- doio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'doio.c') diff --git a/doio.c b/doio.c index 1fcb165065..29b5b19f50 100644 --- a/doio.c +++ b/doio.c @@ -1443,10 +1443,9 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report) char *cmd; /* Make a copy so we can change it */ - const int cmdlen = strlen(incmd); - Newx(cmd, cmdlen+1, char); - strncpy(cmd, incmd, cmdlen); - cmd[cmdlen] = 0; + const Size_t cmdlen = strlen(incmd) + 1; + Newx(cmd, cmdlen, char); + my_strlcpy(cmd, incmd, cmdlen); while (*cmd && isSPACE(*cmd)) cmd++; -- cgit v1.2.1