From 9a21aa2d3c12f988711ecef230e43fe4b7fe640f Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 1 Dec 2015 21:42:07 +0900 Subject: preserve original string for error message --- src/string.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index 9ef5b5fb4..38aa6561e 100644 --- a/src/string.c +++ b/src/string.c @@ -2052,23 +2052,23 @@ mrb_str_len_to_inum(mrb_state *mrb, const char *str, size_t len, int base, int b ISUPPER(c) ? ((c) - 'A' + 10) : \ -1) - if (!str) { + if (!p) { if (badcheck) goto bad; return mrb_fixnum_value(0); } - while (str