1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* bignum.c (conv_digit): use ISDIGIT, ISLOWER and ISUPPER.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-01-02 17:48:20 +00:00
parent 1db9577184
commit 9d52fda376
2 changed files with 7 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Thu Jan 3 02:44:34 2008 Tanaka Akira <akr@fsij.org>
* bignum.c (conv_digit): use ISDIGIT, ISLOWER and ISUPPER.
Wed Jan 2 23:50:15 2008 Tanaka Akira <akr@fsij.org>
* util.c (ruby_strtoul): "0x", "+" and "-" is not a valid integer.

View file

@ -380,9 +380,9 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
#define conv_digit(c) \
(!ISASCII(c) ? -1 : \
isdigit(c) ? ((c) - '0') : \
islower(c) ? ((c) - 'a' + 10) : \
isupper(c) ? ((c) - 'A' + 10) : \
ISDIGIT(c) ? ((c) - '0') : \
ISLOWER(c) ? ((c) - 'a' + 10) : \
ISUPPER(c) ? ((c) - 'A' + 10) : \
-1)
if (!str) {