From da202ffe5a4a0ffdfa642dafc555164cdb6df17d Mon Sep 17 00:00:00 2001 From: Eric Smith Date: Sat, 19 Jul 2008 00:24:05 +0000 Subject: Fix issue 3411: default float format spec fails on negative numbers. --- Python/pystrtod.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Python/pystrtod.c') diff --git a/Python/pystrtod.c b/Python/pystrtod.c index 01c1c42770..302e01298a 100644 --- a/Python/pystrtod.c +++ b/Python/pystrtod.c @@ -302,6 +302,10 @@ ensure_decimal_point(char* buffer, size_t buf_size) /* search for the first non-digit character */ char *p = buffer; + if (*p == '-' || *p == '+') + /* Skip leading sign, if present. I think this could only + ever be '-', but it can't hurt to check for both. */ + ++p; while (*p && isdigit(Py_CHARMASK(*p))) ++p; -- cgit v1.2.1