summaryrefslogtreecommitdiff
path: root/strings/my_strtoll10.c
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-12-16 13:08:17 +0400
committerAlexander Barkov <bar@mariadb.com>2019-12-16 13:08:17 +0400
commit3d98892232359b7262cf82d00bc8f94b1511f26b (patch)
treeb48c157fde886efc051ada08296eb6cb4f4eedc2 /strings/my_strtoll10.c
parenta3a8360d577b44131577c5d40336c632d35487ae (diff)
parentfc860d3fa3bc854fbe6aab9179d7a4aaf6eb9edf (diff)
downloadmariadb-git-3d98892232359b7262cf82d00bc8f94b1511f26b.tar.gz
Merge remote-tracking branch 'origin/5.5' into 10.1
Diffstat (limited to 'strings/my_strtoll10.c')
-rw-r--r--strings/my_strtoll10.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c
index ea556cea127..c6ba5666dde 100644
--- a/strings/my_strtoll10.c
+++ b/strings/my_strtoll10.c
@@ -98,18 +98,25 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error)
if (endptr)
{
end= *endptr;
- while (s != end && (*s == ' ' || *s == '\t'))
+ /* Skip leading spaces */
+ for ( ; s < end && my_isspace(&my_charset_latin1, *s) ; )
s++;
+
if (s == end)
goto no_conv;
}
else
{
endptr= &dummy; /* Easier end test */
- while (*s == ' ' || *s == '\t')
- s++;
- if (!*s)
- goto no_conv;
+ /* Skip leading spaces */
+ for ( ; ; s++)
+ {
+ if (!*s)
+ goto no_conv;
+ if (!my_isspace(&my_charset_latin1, *s))
+ break;
+ }
+
/* This number must be big to guard against a lot of pre-zeros */
end= s+65535; /* Can't be longer than this */
}