summaryrefslogtreecommitdiff
path: root/doio.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 /doio.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 'doio.c')
-rw-r--r--doio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/doio.c b/doio.c
index a63f2a229b..218887d69d 100644
--- a/doio.c
+++ b/doio.c
@@ -377,6 +377,7 @@ Perl_do_open6(pTHX_ GV *gv, const char *oname, STRLEN len,
else {
PerlIO *that_fp = NULL;
int wanted_fd;
+ UV uv;
if (num_svs > 1) {
/* diag_listed_as: More than one argument to '%s' open */
Perl_croak(aTHX_ "More than one argument to '%c&' open",IoTYPE(io));
@@ -390,8 +391,11 @@ Perl_do_open6(pTHX_ GV *gv, const char *oname, STRLEN len,
wanted_fd = SvUV(*svp);
num_svs = 0;
}
- else if (isDIGIT(*type)) {
- wanted_fd = grok_atou(type, NULL);
+ else if (isDIGIT(*type)
+ && grok_atoUV(type, &uv, NULL)
+ && uv <= INT_MAX
+ ) {
+ wanted_fd = (int)uv;
}
else {
const IO* thatio;