mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
2 changed files with 8 additions and 0 deletions
|
@ -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>
|
||||
|
||||
* 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;
|
||||
else base = NUM2INT(b);
|
||||
|
||||
if (base < 0) {
|
||||
rb_raise(rb_eArgError, "illegal radix %d", base);
|
||||
}
|
||||
return rb_str_to_inum(str, base, Qfalse);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue