This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove a call to *printf from the require code.
authorNicholas Clark <nick@ccl4.org>
Tue, 9 Oct 2007 17:56:13 +0000 (17:56 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 9 Oct 2007 17:56:13 +0000 (17:56 +0000)
p4raw-id: //depot/perl@32085

pp_ctl.c

index 774bcb5..af40061 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3026,9 +3026,14 @@ S_doopen_pm(pTHX_ const char *name, const char *mode)
     PerlIO *fp;
 
     if (namelen > 3 && strEQ(name + namelen - 3, ".pm")) {
-       SV * const pmcsv = Perl_newSVpvf(aTHX_ "%s%c", name, 'c');
-       const char * const pmc = SvPV_nolen_const(pmcsv);
+       SV *const pmcsv = newSV(namelen + 2);
+       char *const pmc = SvPVX(pmcsv);
        Stat_t pmcstat;
+
+       memcpy(pmc, name, namelen);
+       pmc[namelen] = 'c';
+       pmc[namelen + 1] = '\0';
+
        if (PerlLIO_stat(pmc, &pmcstat) < 0) {
            fp = check_type_and_open(name, mode);
        }