Skip to content

Commit

Permalink
Fix tonumber
Browse files Browse the repository at this point in the history
  • Loading branch information
vieiraa committed Mar 6, 2020
1 parent 4c9ed58 commit 34189dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extern/lua/lobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ static size_t l_str2dloc(const char* s, lua_Number* result, int mode) {
}
else if (!lisdigit(cast_uchar(*endptr)) && *endptr != '.')
return 0;
else
break;
}

const std::string parsed(s, endptr - s + 1);
Expand All @@ -241,7 +243,7 @@ static size_t l_str2dloc(const char* s, lua_Number* result, int mode) {

*result = parsedNumber.value();

return endptr - s + len;
return endptr - s + len - 1;
}


Expand Down

0 comments on commit 34189dd

Please sign in to comment.