diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-12-16 13:08:17 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-12-16 13:08:17 +0400 |
commit | 3d98892232359b7262cf82d00bc8f94b1511f26b (patch) | |
tree | b48c157fde886efc051ada08296eb6cb4f4eedc2 /strings | |
parent | a3a8360d577b44131577c5d40336c632d35487ae (diff) | |
parent | fc860d3fa3bc854fbe6aab9179d7a4aaf6eb9edf (diff) | |
download | mariadb-git-3d98892232359b7262cf82d00bc8f94b1511f26b.tar.gz |
Merge remote-tracking branch 'origin/5.5' into 10.1
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-simple.c | 3 | ||||
-rw-r--r-- | strings/my_strtoll10.c | 17 |
2 files changed, 14 insertions, 6 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 5cbf5da7990..61d01cc6aef 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -1494,7 +1494,8 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), int shift= 0, digits= 0, negative, addon; /* Skip leading spaces and tabs */ - for ( ; str < end && (*str == ' ' || *str == '\t') ; str++); + for ( ; str < end && my_isspace(&my_charset_latin1, *str) ; ) + str++; if (str >= end) goto ret_edom; 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 */ } |