Commit 39342f4e authored by Guido van Rossum's avatar Guido van Rossum

Patch # 1048 by Amaury Forgeot d'Arc.

test_float crashes on Windows, because the %zd format is used in a call
to PyOS_snprintf().
The attached patch properly uses PY_FORMAT_SIZE_T.
parent fb67be2f
......@@ -694,7 +694,7 @@ _format_float(STRINGLIB_CHAR type, PyObject *value,
/* cast "type", because if we're in unicode we need to pass a
8-bit char. this is safe, because we've restricted what "type"
can be */
PyOS_snprintf(fmt, sizeof(fmt), "%%.%zd%c", precision, (char)type);
PyOS_snprintf(fmt, sizeof(fmt), "%%.%" PY_FORMAT_SIZE_T "d%c", precision, (char)type);
/* call the passed in function to do the actual formatting */
snprintf(charbuf, sizeof(charbuf), fmt, x);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment