From 79c56adea40686bb822c75ec12a72a945d079f41 Mon Sep 17 00:00:00 2001 From: Tyson Grant Nottingham Date: Tue, 22 Jul 2014 21:58:41 -0700 Subject: [PATCH] Don't use isdigit() in fast_atof. --- code/fast_atof.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/fast_atof.h b/code/fast_atof.h index a7f0cb23f..4ff666b38 100644 --- a/code/fast_atof.h +++ b/code/fast_atof.h @@ -236,7 +236,8 @@ inline const char* fast_atoreal_move( const char* c, Real& out, bool check_comma ++c; } - if (!isdigit(*c) && !(*c == '.' && isdigit(c[1]))) + if (!(c[0] >= '0' && c[0] <= '9') && + !(c[0] == '.' && c[1] >= '0' && c[1] <= '9')) { throw std::invalid_argument("Cannot parse string " "as real number: does not start with digit "