summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 8b306197338..4bf7fc02170 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -2293,7 +2293,8 @@ setup_domain_and_type(VALUE domain, int *dv, VALUE type, int *tv)
int family;
domain = tmp;
rb_check_safe_obj(domain);
- family = family_to_int(RSTRING_PTR(domain), RSTRING_LEN(domain));
+ ptr = RSTRING_PTR(domain);
+ family = family_to_int(ptr, RSTRING_LEN(domain));
if (family == -1)
rb_raise(rb_eSocket, "unknown socket domain %s", ptr);
*dv = family;