diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-12-27 13:05:06 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-12-27 15:14:48 +0200 |
commit | 5ab70e7f68ba9659dbdd8c71759cfe99ee90ebf2 (patch) | |
tree | cde569f712505f981e7a43f01e82c600e282c88c /strings/my_strtoll10.c | |
parent | ee9a19fb054085fcea006a25ec957e0d5cb01ce8 (diff) | |
parent | 16bce0f6fe6bcad0091dc45a97a8ac7b33fe9d44 (diff) | |
download | mariadb-git-5ab70e7f68ba9659dbdd8c71759cfe99ee90ebf2.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'strings/my_strtoll10.c')
-rw-r--r-- | strings/my_strtoll10.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c index 2311b4e5079..183829d7074 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 */ } |