LibC: set endp in string to float conversion error

This commit is contained in:
Bananymous 2026-03-17 19:50:12 +02:00
parent 8fac88c9a6
commit 07201c711e
1 changed files with 2 additions and 0 deletions

View File

@ -211,6 +211,8 @@ static T strtoT(const char* str, char** endp, int& error)
// no conversion can be performed -- not ([digit] || .[digit])
if (!(isdigit(*str) || (str[0] == '.' && isdigit(str[1]))))
{
if (endp)
*endp = const_cast<char*>(str);
error = EINVAL;
return 0;
}