mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 15:27:36 +02:00
Issue #136 - trailing whitespace in string->number
Allow trailing whitespace, which allows us to accept a wider range of input.
This commit is contained in:
parent
a898c99c9e
commit
3ab8ec401f
1 changed files with 1 additions and 1 deletions
|
@ -1719,7 +1719,7 @@ object Cyc_string2number_(void *data, object cont, object str)
|
|||
} else {
|
||||
char *str_end;
|
||||
n = strtold(s, &str_end);
|
||||
if (s != str_end && *str_end == '\0') {
|
||||
if (s != str_end && (*str_end == '\0' || isspace(*str_end))) {
|
||||
make_double(result, n);
|
||||
_return_closcall1(data, cont, &result);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue