diff options
author | Karl Williamson <khw@cpan.org> | 2014-05-04 18:58:51 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-05-30 16:13:46 -0600 |
commit | 30a15352eb3f11a226bd42ec93797b1e778f6e9f (patch) | |
tree | b6312c87cc3f28fe38159d37a71bafa7834234b7 /sv.c | |
parent | 6602b93363649555eb1086b0efd043f7ffa7d0b5 (diff) | |
download | perl-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.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 */ |