diff options
author | Guido van Rossum <guido@python.org> | 2007-08-29 18:42:15 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-08-29 18:42:15 (GMT) |
commit | 39342f4e65afdb0a6a4be493dbbbf6fc28357787 (patch) | |
tree | c0a274891ba387a82f1f8edba1ef33cb045d114d /Objects | |
parent | fb67be2f6b12e6ab07c17ece1caaf0057d610252 (diff) | |
download | cpython-39342f4e65afdb0a6a4be493dbbbf6fc28357787.zip cpython-39342f4e65afdb0a6a4be493dbbbf6fc28357787.tar.gz cpython-39342f4e65afdb0a6a4be493dbbbf6fc28357787.tar.bz2 |
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.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/stringlib/formatter.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringlib/formatter.h b/Objects/stringlib/formatter.h index fd7b123..c408350 100644 --- a/Objects/stringlib/formatter.h +++ b/Objects/stringlib/formatter.h @@ -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); |