number parsing fix

This commit is contained in:
VaclavT 2021-05-20 23:05:57 +02:00
parent b7fd6a9411
commit 20b2f8e112
1 changed files with 1 additions and 1 deletions

2
ml.cpp
View File

@ -812,7 +812,7 @@ MlValue parse(std::string &s, int &ptr) {
int save_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);
if (n.find('.') != std::string::npos)