summaryrefslogtreecommitdiff
path: root/pod/perlclib.pod
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-05-01 14:23:23 -0600
committerKarl Williamson <khw@cpan.org>2018-06-25 07:33:26 -0600
commit5d4a52b5c68a11bfc97c2e24806993b84a61eade (patch)
tree32adacfa73add58acad66f7a533957d56bd45d11 /pod/perlclib.pod
parent6928bedc792ff80f0cb915460a7eacae25fa9bdd (diff)
downloadperl-5d4a52b5c68a11bfc97c2e24806993b84a61eade.tar.gz
grok_atoUV: allow non-C strings and document
This changes the internal function grok_atoUV() to not require its input to be NUL-terminated. That means the existing calls to it must be changed to set the ending position before calling it, as some did already. This function is recommended to use in a couple of pods, but it wasn't documented in perlintern. This commit does that as well.
Diffstat (limited to 'pod/perlclib.pod')
-rw-r--r--pod/perlclib.pod3
1 files changed, 2 insertions, 1 deletions
diff --git a/pod/perlclib.pod b/pod/perlclib.pod
index 1e6cf779a0..176f8548ee 100644
--- a/pod/perlclib.pod
+++ b/pod/perlclib.pod
@@ -211,7 +211,8 @@ C<toUPPER_uni>, as described in L<perlapi/Character case changing>.)
Typical use is to do range checks on C<uv> before casting:
- int i; UV uv; char* end_ptr;
+ int i; UV uv;
+ char* end_ptr = input_end;
if (grok_atoUV(input, &uv, &end_ptr)
&& uv <= INT_MAX)
i = (int)uv;