summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2012-02-15 12:30:32 +0100
committerNicholas Clark <nick@ccl4.org>2012-02-15 12:30:32 +0100
commit1876195675e4875a2804e1db82332dbed40b6d98 (patch)
tree2da682373c41651246b1279383c26a80e902ff5c /sv.c
parent27f98b9ec2d029bfc9cd86e96cbd6a2a061a0a3e (diff)
downloadperl-1876195675e4875a2804e1db82332dbed40b6d98.tar.gz
Clarify the newSVpvn documentation.
"string" is now called "buffer", and we mention that it might contain NUL characters.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sv.c b/sv.c
index 214a17d44b..a6cede7a0c 100644
--- a/sv.c
+++ b/sv.c
@@ -8387,22 +8387,24 @@ Perl_newSVpv(pTHX_ const char *const s, const STRLEN len)
/*
=for apidoc newSVpvn
-Creates a new SV and copies a string into it. The reference count for the
-SV is set to 1. Note that if C<len> is zero, Perl will create a zero length
-string. You are responsible for ensuring that the source string is at least
-C<len> bytes long. If the C<s> argument is NULL the new SV will be undefined.
+Creates a new SV and copies a buffer into it, which may contain NUL characters
+(C<\0>) and other binary data. The reference count for the SV is set to 1.
+Note that if C<len> is zero, Perl will create a zero length (Perl) string. You
+are responsible for ensuring that the source buffer is at least
+C<len> bytes long. If the C<buffer> argument is NULL the new SV will be
+undefined.
=cut
*/
SV *
-Perl_newSVpvn(pTHX_ const char *const s, const STRLEN len)
+Perl_newSVpvn(pTHX_ const char *const buffer, const STRLEN len)
{
dVAR;
register SV *sv;
new_SV(sv);
- sv_setpvn(sv,s,len);
+ sv_setpvn(sv,buffer,len);
return sv;
}