diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-07-21 10:41:20 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-07-22 21:31:41 -0400 |
commit | 6313e54401f5531a23184b7afaaf6bc7cd4a81ec (patch) | |
tree | 8a09ae74353a6697f0e652b1d8577441f3cb456e /proto.h | |
parent | 6e75769d300856d7c215fc22d503cce13b734a0f (diff) | |
download | perl-6313e54401f5531a23184b7afaaf6bc7cd4a81ec.tar.gz |
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.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) |