From 6313e54401f5531a23184b7afaaf6bc7cd4a81ec Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 21 Jul 2014 10:41:20 -0400 Subject: Implement grok_atou as safe/strict atoi replacement. For earlier discussion, see: http://www.nntp.perl.org/group/perl.perl5.porters/2013/10/msg208680.html https://rt.perl.org/Public/Bug/Display.html?id=116118#txn-1250187 grok_atou is completely new code, instead of trying to bolt new parameters/flags to grok_number. This makes it easier to be extremely strict, and not worry about breaking grok_number. --- proto.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'proto.h') diff --git a/proto.h b/proto.h index 49a44d2bb9..1eccc462d3 100644 --- a/proto.h +++ b/proto.h @@ -1289,6 +1289,11 @@ PERL_CALLCONV int Perl_getcwd_sv(pTHX_ SV* sv) PERL_CALLCONV void Perl_gp_free(pTHX_ GV* gv); PERL_CALLCONV GP* Perl_gp_ref(pTHX_ GP* gp); +PERL_CALLCONV Size_t Perl_grok_atou(const char* pv, const char** endptr) + __attribute__nonnull__(1); +#define PERL_ARGS_ASSERT_GROK_ATOU \ + assert(pv) + PERL_CALLCONV UV Perl_grok_bin(pTHX_ const char* start, STRLEN* len_p, I32* flags, NV *result) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2) -- cgit v1.2.1