From: Marcus Holland-Moritz Date: Fri, 4 Jun 2004 16:29:44 +0000 (+0200) Subject: Re: newSVpvn(NULL, 0); doesn't work as advertised X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9e09f5f2a061547beb0a25b560bc3ef946da9413;p=p5sagit%2Fp5-mst-13.2.git Re: newSVpvn(NULL, 0); doesn't work as advertised Message-Id: <20040604162944.4011f1c6@r2d2> p4raw-id: //depot/perl@22905 --- diff --git a/pod/perlapi.pod b/pod/perlapi.pod index 7505652..c8f1bfd 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -2866,7 +2866,7 @@ Found in file sv.c Creates a new SV and copies a string into it. The reference count for the SV is set to 1. Note that if C is zero, Perl will create a zero length string. You are responsible for ensuring that the source string is at least -C bytes long. +C bytes long. If the C argument is NULL the new SV will be undefined. SV* newSVpvn(const char* s, STRLEN len) @@ -4559,7 +4559,8 @@ Found in file sv.c =item sv_setpvn Copies a string into an SV. The C parameter indicates the number of -bytes to be copied. Does not handle 'set' magic. See C. +bytes to be copied. If the C argument is NULL the SV will become +undefined. Does not handle 'set' magic. See C. void sv_setpvn(SV* sv, const char* ptr, STRLEN len) diff --git a/sv.c b/sv.c index 501d09f..fe1d406 100644 --- a/sv.c +++ b/sv.c @@ -4760,7 +4760,8 @@ Perl_sv_setsv_cow(pTHX_ SV *dstr, SV *sstr) =for apidoc sv_setpvn Copies a string into an SV. The C parameter indicates the number of -bytes to be copied. Does not handle 'set' magic. See C. +bytes to be copied. If the C argument is NULL the SV will become +undefined. Does not handle 'set' magic. See C. =cut */ @@ -7616,7 +7617,7 @@ Perl_newSVpv(pTHX_ const char *s, STRLEN len) Creates a new SV and copies a string into it. The reference count for the SV is set to 1. Note that if C is zero, Perl will create a zero length string. You are responsible for ensuring that the source string is at least -C bytes long. +C bytes long. If the C argument is NULL the new SV will be undefined. =cut */