This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix Borland problem with quoted pre-processor macros in response files
[perl5.git] / doio.c
diff --git a/doio.c b/doio.c
index 1fcb165..809459f 100644 (file)
--- 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++;
@@ -2274,7 +2273,7 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp)
        STRLEN len;
 
        const char *mbuf = SvPV_const(mstr, len);
-       const I32 n = (len > msize) ? msize : len;
+       const I32 n = ((I32)len > msize) ? msize : (I32)len;
        Copy(mbuf, shm + mpos, n, char);
        if (n < msize)
            memzero(shm + mpos + n, msize - n);