summaryrefslogtreecommitdiff
path: root/Python/pystrtod.c
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2008-07-19 00:33:23 +0000
committerEric Smith <eric@trueblade.com>2008-07-19 00:33:23 +0000
commitce492b3f364805a0c35368c790ad04056dbd69ed (patch)
tree64937603b06d33d83c5aeb62718fa5d7d29f9b51 /Python/pystrtod.c
parent781c1622218345b3abc256e5485e1fe5639e38c5 (diff)
downloadcpython-ce492b3f364805a0c35368c790ad04056dbd69ed.tar.gz
Merged revisions 65125 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r65125 | eric.smith | 2008-07-18 20:24:05 -0400 (Fri, 18 Jul 2008) | 1 line Fix issue 3411: default float format spec fails on negative numbers. ........
Diffstat (limited to 'Python/pystrtod.c')
-rw-r--r--Python/pystrtod.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index 5a96b58e15..b3738528db 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;