diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-17 15:43:47 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-17 15:43:47 +0000 |
| commit | 4e54eab282775d5805038f3dc6ca267a51bbd7d1 (patch) | |
| tree | 2a63e2ac85108a1da2f27ccf44a43b164d1bf0af /util.c | |
| parent | a255f0bbc3e6d7b0cf187c057b4c8650bf233ee2 (diff) | |
| download | ruby-4e54eab282775d5805038f3dc6ca267a51bbd7d1.tar.gz ruby-4e54eab282775d5805038f3dc6ca267a51bbd7d1.tar.xz ruby-4e54eab282775d5805038f3dc6ca267a51bbd7d1.zip | |
* util.c (ruby_strtod): stop at dot not followed by digits.
fixed: [ruby-dev:29035]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
| -rw-r--r-- | util.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -783,9 +783,9 @@ ruby_strtod(string, endPtr) * and also locate the decimal point. */ - for ( ; c = *p; p++) { + for ( ; (c = *p) != '\0'; p++) { if (!ISDIGIT(c)) { - if (c != '.' || hasPoint) { + if (c != '.' || hasPoint || !ISDIGIT(p[1])) { break; } hasPoint = Qtrue; |
