summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-05-04 18:58:51 -0600
committerKarl Williamson <khw@cpan.org>2014-05-30 16:13:46 -0600
commit30a15352eb3f11a226bd42ec93797b1e778f6e9f (patch)
treeb6312c87cc3f28fe38159d37a71bafa7834234b7 /sv.c
parent6602b93363649555eb1086b0efd043f7ffa7d0b5 (diff)
downloadperl-30a15352eb3f11a226bd42ec93797b1e778f6e9f.tar.gz
perlapi: Clarify some instances where NUL is or isn't permitted
Some functions that take a string/length pair can have embedded NULs and don't have to be NUL terminated; others are the opposite. This adds text to clarify the issue.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sv.c b/sv.c
index bde719b7d6..76ca0d9665 100644
--- a/sv.c
+++ b/sv.c
@@ -8864,7 +8864,8 @@ Perl_sv_newmortal(pTHX)
/*
=for apidoc newSVpvn_flags
-Creates a new SV and copies a string into it. The reference count for the
+Creates a new SV and copies a string (which may contain C<NUL> (C<\0>)
+characters) 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.
@@ -8938,9 +8939,13 @@ Perl_sv_2mortal(pTHX_ SV *const sv)
/*
=for apidoc newSVpv
-Creates a new SV and copies a string into it. The reference count for the
+Creates a new SV and copies a string (which may contain C<NUL> (C<\0>)
+characters) into it. The reference count for the
SV is set to 1. If C<len> is zero, Perl will compute the length using
-strlen(). For efficiency, consider using C<newSVpvn> instead.
+strlen(), (which means if you use this option, that C<s> can't have embedded
+C<NUL> characters and has to have a terminating C<NUL> byte).
+
+For efficiency, consider using C<newSVpvn> instead.
=cut
*/