diff -r 00348c0518f8 Python/dtoa.c --- a/Python/dtoa.c Mon Nov 18 10:04:07 2013 +0100 +++ b/Python/dtoa.c Mon Nov 18 10:18:53 2013 +0100 @@ -1531,6 +1531,7 @@ { int bb2, bb5, bbe, bd2, bd5, bs2, c, dsign, e, e1, error; int esign, i, j, k, lz, nd, nd0, odd, sign; + Py_ssize_t tmp; const char *s, *s0, *s1; double aadj, aadj1; U aadj2, adj, rv, rv0; @@ -1566,7 +1567,8 @@ s0 = s1 = s; while ('0' <= c && c <= '9') c = *++s; - nd0 = nd = s - s1; + tmp = s - s1; + nd0 = nd = Py_SAFE_DOWNCAST(tmp, Py_SSIZE_T, int); /* Parse decimal point and following digits. */ if (c == '.') { @@ -1576,13 +1578,15 @@ while (c == '0') c = *++s; lz = lz || s != s1; - nd0 -= s - s1; + tmp = nd0 - (s - s1); + nd0 = Py_SAFE_DOWNCAST(tmp, Py_SSIZE_T, int); s0 = s; } s1 = s; while ('0' <= c && c <= '9') c = *++s; - nd += s - s1; + tmp = nd + (s - s1); + nd = Py_SAFE_DOWNCAST(tmp, Py_SSIZE_T, int); } /* Now lz is true if and only if there were leading zero digits, and nd