diff options
Diffstat (limited to 'Python/pystrtod.c')
-rw-r--r-- | Python/pystrtod.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pystrtod.c b/Python/pystrtod.c index 5a96b58..b373852 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; |