From 48febcf78552ffedb97816a556ca2226f4879a48 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Fri, 17 Apr 2026 13:53:01 -0700 Subject: [PATCH] stringFloat Signed-off-by: James Cherry --- util/StringUtil.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/StringUtil.cc b/util/StringUtil.cc index 808365cd..a6edc3f4 100644 --- a/util/StringUtil.cc +++ b/util/StringUtil.cc @@ -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};