number parsing fix
This commit is contained in:
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user