]> granicus.if.org Git - python/commitdiff
Fix the second occurrence of the problematic printf format.
authorThomas Heller <theller@ctypes.org>
Sat, 10 Jun 2006 21:17:58 +0000 (21:17 +0000)
committerThomas Heller <theller@ctypes.org>
Sat, 10 Jun 2006 21:17:58 +0000 (21:17 +0000)
Modules/_ctypes/_ctypes.c

index 13ac4142e8e780c1a1fedf4dc12143edb9024499..5d29cda26199231afcee49ad5663cdb0674d5239 100644 (file)
@@ -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;
        }