summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorTAKAI Kousuke <62541129+t-a-k@users.noreply.github.com>2022-07-08 21:07:17 +0900
committerTony Cook <tony@develop-help.com>2022-07-11 11:12:28 +1000
commitb04606273aff02cd30bd1d7dff2797554474eec8 (patch)
tree9c0700f0bb8338c8ff7bf255ee975ac140f1c055 /pp_sys.c
parentf192c227eefb2861335e0592230df7f6d7607abf (diff)
downloadperl-b04606273aff02cd30bd1d7dff2797554474eec8.tar.gz
setsockopt: treat boolean values as numbers
Boolean values used to be treated as string, but this is not desirable. (thanks to @tonycoz) Also added tests for this.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index bb280d2e7a..09f6b8f8f8 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2723,7 +2723,7 @@ PP(pp_ssockopt)
const char *buf;
int aint;
SvGETMAGIC(sv);
- if (SvPOK(sv)) { /* sv is originally a string */
+ if (SvPOK(sv) && !SvIsBOOL(sv)) { /* sv is originally a string */
STRLEN l;
buf = SvPVbyte_nomg(sv, l);
len = l;