summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2015-02-23 16:48:15 +0000
committerHugo van der Sanden <hv@crypt.org>2015-03-09 22:15:46 +0000
commit22ff313068aa37b1a24855e760e71ee9a20a1a90 (patch)
tree09da195258e4a85e42a39dd24d7c60c849409ef1 /pp_sys.c
parent35cd12d12a5a5777098caf722f8748b39c3be45f (diff)
downloadperl-22ff313068aa37b1a24855e760e71ee9a20a1a90.tar.gz
[perl #123814] replace grok_atou with grok_atoUV
Some questions and loose ends: XXX gv.c:S_gv_magicalize - why are we using SSize_t for paren? XXX mg.c:Perl_magic_set - need appopriate error handling for $) XXX regcomp.c:S_reg - need to check if we do the right thing if parno was not grokked Perl_get_debug_opts should probably return something unsigned; not sure if that's something we can change.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index e2f8edf9de..2f70006842 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3340,6 +3340,7 @@ PP(pp_fttty)
GV *gv;
char *name = NULL;
STRLEN namelen;
+ UV uv;
tryAMAGICftest_MG('t');
@@ -3355,8 +3356,8 @@ PP(pp_fttty)
if (GvIO(gv) && IoIFP(GvIOp(gv)))
fd = PerlIO_fileno(IoIFP(GvIOp(gv)));
- else if (name && isDIGIT(*name))
- fd = grok_atou(name, NULL);
+ else if (name && isDIGIT(*name) && grok_atoUV(name, &uv, NULL) && uv <= PERL_INT_MAX)
+ fd = (int)uv;
else
FT_RETURNUNDEF;
if (fd < 0) {