summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorGisle Aas <gisle@aas.no>2005-10-20 22:24:30 -0700
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-10-21 13:24:30 +0000
commit4ef2275c8517a5b084d75f6179d5b49f77f76d2c (patch)
treeb75ca8419e506e06ff04a1807ac13a55189b0e11 /pp_sys.c
parentdbb128be9d98f2152d3ce957d4c3c518a9f86260 (diff)
downloadperl-4ef2275c8517a5b084d75f6179d5b49f77f76d2c.tar.gz
wrong maxlen in sselect [PATCH]
Message-ID: <lrzmp312ip.fsf@caliper.activestate.com> Plus a regression test for the new warning. p4raw-id: //depot/perl@25813
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/pp_sys.c b/pp_sys.c
index c2ae68152d..cf6a862c29 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1037,8 +1037,13 @@ PP(pp_sselect)
if (SvREADONLY(sv))
DIE(aTHX_ PL_no_modify);
}
- if (!SvPOK(sv))
+ if (!SvOK(sv))
continue;
+ if (!SvPOK(sv)) {
+ if (ckWARN(WARN_MISC))
+ Perl_warner(aTHX_ packWARN(WARN_MISC), "Non-string passed as bitmask");
+ SvPV_force_nolen(sv); /* force string conversion */
+ }
j = SvCUR(sv);
if (maxlen < j)
maxlen = j;
@@ -1092,8 +1097,7 @@ PP(pp_sselect)
fd_sets[i] = 0;
continue;
}
- else if (!SvPOK(sv))
- SvPV_force_nolen(sv); /* force string conversion */
+ assert(SvPOK(sv));
j = SvLEN(sv);
if (j < growsize) {
Sv_Grow(sv, growsize);