From 5d4a52b5c68a11bfc97c2e24806993b84a61eade Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 1 May 2018 14:23:23 -0600 Subject: 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. --- util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index 647f53307d..7282dd9cfe 100644 --- a/util.c +++ b/util.c @@ -4320,7 +4320,7 @@ Perl_parse_unicode_opts(pTHX_ const char **popt) if (*p) { if (isDIGIT(*p)) { - const char* endptr; + const char* endptr = p + strlen(p); UV uv; if (grok_atoUV(p, &uv, &endptr) && uv <= U32_MAX) { opt = (U32)uv; @@ -4707,7 +4707,7 @@ S_mem_log_common(enum mem_log_type mlt, const UV n, * timeval. */ { STRLEN len; - const char* endptr; + const char* endptr = pmlenv + stren(pmlenv); int fd; UV uv; if (grok_atoUV(pmlenv, &uv, &endptr) /* Ignore endptr. */ @@ -5989,7 +5989,7 @@ static const char* atos_parse(const char* p, * The matched regular expression is roughly "\(.*:\d+\)\s*$" */ const char* source_number_start; const char* source_name_end; - const char* source_line_end; + const char* source_line_end = start; const char* close_paren; UV uv; -- cgit v1.2.1