diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-12-23 07:14:51 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-12-23 07:14:51 +0200 |
commit | 73985d83014e2a484dffac135193a2f0cf715b54 (patch) | |
tree | 7167799ebc178519babd7000c76234665a9d6030 /strings | |
parent | 496532b5c54d69e012f6fc2417e97d61465588f2 (diff) | |
parent | aade6e53d398dd287ca7e771191c9975099b4fa1 (diff) | |
download | mariadb-git-73985d83014e2a484dffac135193a2f0cf715b54.tar.gz |
Merge 10.1 into 10.2
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 1c382de5e28..3254be51740 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -1598,7 +1598,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 */ } |