Skip to content

Commit 5e8aec0

Browse files
committed
Use PyLong_AsSsize_t to convert to Py_ssize_t
1 parent a3bd171 commit 5e8aec0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/_ctypes/stgdict.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
292292
if (!tmp) {
293293
goto error;
294294
}
295-
Py_ssize_t total_align = PyLong_AsInt(tmp);
295+
Py_ssize_t total_align = PyLong_AsSsize_t(tmp);
296296
Py_DECREF(tmp);
297297
if (total_align < 0) {
298298
if (!PyErr_Occurred()) {
@@ -306,7 +306,7 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
306306
if (!tmp) {
307307
goto error;
308308
}
309-
Py_ssize_t total_size = PyLong_AsInt(tmp);
309+
Py_ssize_t total_size = PyLong_AsSsize_t(tmp);
310310
Py_DECREF(tmp);
311311
if (total_size < 0) {
312312
if (!PyErr_Occurred()) {

0 commit comments

Comments
 (0)