summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-simple.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 8b1b0d6790d..e073262cd4c 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1538,14 +1538,18 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
}
else
addon= (*str >= '5');
- for ( ; str < end && (ch= (unsigned char) (*str - '0')) < 10; str++)
+ if (!dot)
{
- if (!dot)
- shift++;
+ for ( ; str < end && (ch= (unsigned char) (*str - '0')) < 10; shift++, str++);
+ if (str < end && *str == '.')
+ {
+ str++;
+ for ( ; str < end && (ch= (unsigned char) (*str - '0')) < 10; str++);
+ }
}
- if (str < end && *str == '.' && !dot)
+ else
{
- str++;
+ shift= dot - str;
for ( ; str < end && (ch= (unsigned char) (*str - '0')) < 10; str++);
}
goto exp;