stringFloat

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry
2026-04-17 13:53:01 -07:00
parent 53a1552ab0
commit 48febcf785

View File

@@ -67,8 +67,9 @@ stringFloat(const std::string &str)
return {0.0, false};
#else
char *ptr;
errno = 0;
value = strtof(str.data(), &ptr);
if (!errno || *ptr != '\0')
if (errno != 0 || *ptr != '\0')
return {0.0, false};
else
return {value, true};