This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ext/PerlIO-encoding: use SvPVCLEAR()
authorYves Orton <demerphq@gmail.com>
Wed, 19 Oct 2016 08:50:58 +0000 (10:50 +0200)
committerYves Orton <demerphq@gmail.com>
Wed, 19 Oct 2016 11:28:00 +0000 (13:28 +0200)
ext/PerlIO-encoding/encoding.xs

index 1101bf1..bb4754f 100644 (file)
@@ -203,7 +203,7 @@ PerlIOEncode_get_base(pTHX_ PerlIO * f)
        e->base.bufsiz = 1024;
     if (!e->bufsv) {
        e->bufsv = newSV(e->base.bufsiz);
-       sv_setpvs(e->bufsv, "");
+       SvPVCLEAR(e->bufsv);
     }
     e->base.buf = (STDCHAR *) SvPVX(e->bufsv);
     if (!e->base.ptr)