From 1876195675e4875a2804e1db82332dbed40b6d98 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Wed, 15 Feb 2012 12:30:32 +0100 Subject: [PATCH] Clarify the newSVpvn documentation. "string" is now called "buffer", and we mention that it might contain NUL characters. --- sv.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sv.c b/sv.c index 214a17d..a6cede7 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 is zero, Perl will create a zero length -string. You are responsible for ensuring that the source string is at least -C bytes long. If the C 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 is zero, Perl will create a zero length (Perl) string. You +are responsible for ensuring that the source buffer is at least +C bytes long. If the C 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; } -- 1.8.3.1