diff options
Diffstat (limited to 'sql/time.cc')
-rw-r--r-- | sql/time.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/time.cc b/sql/time.cc index 6b2f8b710da..94f9cb2e5e8 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -639,9 +639,11 @@ bool str_to_time(const char *str,uint length,TIME *l_time) for (value=0; str != end && my_isdigit(&my_charset_latin1,*str) ; str++) value=value*10L + (long) (*str - '0'); - if (*str == ' ') + /* Move to last space */ + if (str != end && *str == ' ') { - while (++str != end && str[0] == ' ') ; + while (++str != end && str[0] == ' ') + {} str--; } |