number parsing fix
This commit is contained in:
parent
b7fd6a9411
commit
20b2f8e112
2
ml.cpp
2
ml.cpp
|
|
@ -812,7 +812,7 @@ MlValue parse(std::string &s, int &ptr) {
|
||||||
|
|
||||||
int save_ptr = ptr;
|
int save_ptr = ptr;
|
||||||
while (isdigit(s[ptr]) || s[ptr] == '.') ptr++;
|
while (isdigit(s[ptr]) || s[ptr] == '.') ptr++;
|
||||||
std::string n = s.substr(save_ptr, ptr);
|
std::string n = s.substr(save_ptr, ptr - save_ptr);
|
||||||
skip_whitespace(s, ptr);
|
skip_whitespace(s, ptr);
|
||||||
|
|
||||||
if (n.find('.') != std::string::npos)
|
if (n.find('.') != std::string::npos)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue