From 95c898f37bb90c0c5b1ce1f11d1aeb9fc7369994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 15 Nov 2009 19:07:36 +0100 Subject: [PATCH] Fixed #891 (false positive: division by zero) --- lib/mathlib.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/mathlib.cpp b/lib/mathlib.cpp index eee62c89f..0354a646e 100644 --- a/lib/mathlib.cpp +++ b/lib/mathlib.cpp @@ -51,7 +51,10 @@ double MathLib::toDoubleNumber(const std::string &str) { return std::strtoul(str.c_str(), '\0', 16); } - return std::atof(str.c_str()); + std::istringstream istr(str.c_str()); + double ret; + istr >> ret; + return ret; } template