summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-06-10 21:17:58 (GMT)
committerThomas Heller <theller@ctypes.org>2006-06-10 21:17:58 (GMT)
commiteb6dcf6b0d9a43015a5303736952d90a654b1555 (patch)
treeedfc03c1822f6e9caf72119bcdb0a36b4f65d799 /Modules
parent5218ab263a81ac93859bc1d3da789e297b24f970 (diff)
downloadcpython-eb6dcf6b0d9a43015a5303736952d90a654b1555.zip
cpython-eb6dcf6b0d9a43015a5303736952d90a654b1555.tar.gz
cpython-eb6dcf6b0d9a43015a5303736952d90a654b1555.tar.bz2
Fix the second occurrence of the problematic printf format.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/_ctypes.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 13ac414..5d29cda 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -1840,11 +1840,7 @@ unique_key(CDataObject *target, Py_ssize_t index)
#if (PY_VERSION_HEX < 0x02050000)
cp += sprintf(cp, ":%x", (int)target->b_index);
#else
-#ifdef MS_WIN32
- cp += sprintf(cp, ":%Ix", (size_t)target->b_index);
-#else
- cp += sprintf(cp, ":%zx", (size_t)target->b_index);
-#endif
+ cp += sprintf(cp, ":%x", Py_SAFE_DOWNCAST(target->b_index, Py_ssize_t, int));
#endif
target = target->b_base;
}