]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a wrong printf format.
authorThomas Heller <theller@ctypes.org>
Sat, 10 Jun 2006 21:07:19 +0000 (21:07 +0000)
committerThomas Heller <theller@ctypes.org>
Sat, 10 Jun 2006 21:07:19 +0000 (21:07 +0000)
Modules/_ctypes/_ctypes.c

index 121c37c1e6cbad7eec4366c7c750a521f19d2eea..13ac4142e8e780c1a1fedf4dc12143edb9024499 100644 (file)
@@ -1827,12 +1827,7 @@ unique_key(CDataObject *target, Py_ssize_t index)
 #if (PY_VERSION_HEX < 0x02050000)
        cp += sprintf(cp, "%x", index);
 #else
-#ifdef MS_WIN32
-/* MSVC does not understand the 'z' size specifier */
-       cp += sprintf(cp, "%Ix", index);
-#else
-       cp += sprintf(cp, "%zx", index);
-#endif
+       cp += sprintf(cp, "%x", Py_SAFE_DOWNCAST(index, Py_ssize_t, int));
 #endif
        while (target->b_base) {
                bytes_left = sizeof(string) - (cp - string) - 1;