* string.c (rb_str_to_i): disallow negative radix.
[ruby-dev:20087] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
38bde8a9e0
commit
93695ed08a
@ -1,3 +1,8 @@
|
|||||||
|
Sun Apr 27 23:13:20 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* string.c (rb_str_to_i): disallow negative radix.
|
||||||
|
[ruby-dev:20087]
|
||||||
|
|
||||||
Sat Apr 26 23:34:42 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Sat Apr 26 23:34:42 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (open_args): warning message changed to "don't put space
|
* parse.y (open_args): warning message changed to "don't put space
|
||||||
|
3
string.c
3
string.c
@ -1836,6 +1836,9 @@ rb_str_to_i(argc, argv, str)
|
|||||||
if (argc == 0) base = 10;
|
if (argc == 0) base = 10;
|
||||||
else base = NUM2INT(b);
|
else base = NUM2INT(b);
|
||||||
|
|
||||||
|
if (base < 0) {
|
||||||
|
rb_raise(rb_eArgError, "illegal radix %d", base);
|
||||||
|
}
|
||||||
return rb_str_to_inum(str, base, Qfalse);
|
return rb_str_to_inum(str, base, Qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user