We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ffe1edd commit f353127Copy full SHA for f353127
1 file changed
src/ifcparse/IfcParse.cpp
@@ -348,7 +348,11 @@ bool TokenFunc::asBool(const Token& t) {
348
}
349
double TokenFunc::asFloat(const Token& t) {
350
const std::string str = asString(t);
351
- return (double) atof(str.c_str());
+ const char* start = str.c_str();
352
+ char* end;
353
+ double result = strtod(start,&end);
354
+ if ( start == end ) throw IfcException("Token is not a real");
355
+ return result;
356
357
std::string TokenFunc::asString(const Token& t) {
358
if ( isOperator(t,'$') ) return "";
0 commit comments