This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
NULL and sv_setpv vs. newSVpv
authorYitzchak Scott-Thoennes <sthoenna@efn.org>
Sun, 10 Sep 2006 20:31:46 +0000 (13:31 -0700)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 11 Sep 2006 08:41:50 +0000 (08:41 +0000)
From: "Yitzchak Scott-Thoennes" <sthoenna@efn.org>
Message-ID: <8750.24.19.24.170.1157945506.squirrel@24.19.24.170>

p4raw-id: //depot/perl@28813

sv.c

diff --git a/sv.c b/sv.c
index 1673341..82c5b23 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -6933,7 +6933,7 @@ Perl_newSVpv(pTHX_ const char *s, STRLEN len)
     register SV *sv;
 
     new_SV(sv);
-    sv_setpvn(sv,s,len ? len : strlen(s));
+    sv_setpvn(sv, s, len || s == NULL ? len : strlen(s));
     return sv;
 }