diff options
Diffstat (limited to 'ext/socket/constants.c')
| -rw-r--r-- | ext/socket/constants.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/socket/constants.c b/ext/socket/constants.c index bab27b23bb..1213f2ae17 100644 --- a/ext/socket/constants.c +++ b/ext/socket/constants.c @@ -22,19 +22,18 @@ constant_arg(VALUE arg, int (*str_to_int)(const char*, long, int*), const char * int ret; if (SYMBOL_P(arg)) { - arg = rb_sym_to_s(arg); + arg = rb_sym2str(arg); goto str; } else if (!NIL_P(tmp = rb_check_string_type(arg))) { - arg = tmp; + arg = tmp; str: - rb_check_safe_obj(arg); ptr = RSTRING_PTR(arg); if (str_to_int(ptr, RSTRING_LEN(arg), &ret) == -1) - rb_raise(rb_eSocket, "%s: %s", errmsg, ptr); + rb_raise(rb_eSocket, "%s: %s", errmsg, ptr); } else { - ret = NUM2INT(arg); + ret = NUM2INT(arg); } return ret; } |
