Permalink
Browse files

mrb_str_to_inum(): no need to call mrb_string_value_cstr() here; ref 0…

  • Loading branch information...
matz committed Dec 1, 2015
1 parent 05411ee commit 9f2fca6ebeacaf35a2f6e17c30c9024c730c54d7
Showing with 1 addition and 7 deletions.
  1. +1 −7 src/string.c
View
@@ -2198,13 +2198,7 @@ mrb_str_to_inum(mrb_state *mrb, mrb_value str, mrb_int base, mrb_bool badcheck)
const char *s;
mrb_int len;
if (badcheck) {
/* Raises if the string contains a null character (the badcheck) */
s = mrb_string_value_cstr(mrb, &str);
}
else {
s = mrb_string_value_ptr(mrb, str);
}
s = mrb_string_value_ptr(mrb, str);
if (s) {
len = RSTRING_LEN(str);
if (s[len]) { /* no sentinel somehow */

0 comments on commit 9f2fca6

Please sign in to comment.