summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-08 05:34:58 (GMT)
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-08 05:34:58 (GMT)
commita74d08b957b9896e69bde1c9f571fdc5022fbdfb (patch)
tree2e7230341b9a0b2590a162c6141b14f402f3c8da /util.c
parent7b9dd379bfe4d597acfe4c26365feff61dabd488 (diff)
svn merge -r 65625:65623 .
Was breaking make test-all git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/util.c b/util.c
index 1d95da9..0e49e44 100644
--- a/util.c
+++ b/util.c
@@ -35,12 +35,8 @@ ruby_scan_oct(const char *start, size_t len, size_t *retlen)
{
register const char *s = start;
register unsigned long retval = 0;
- size_t i;
- for (i = 0; i < len; i++) {
- if ((s[0] < '0') || ('7' <= s[0])) {
- break;
- }
+ while (len-- && *s >= '0' && *s <= '7') {
retval <<= 3;
retval |= *s++ - '0';
}