Skip to content

Commit c69b65f

Browse files
committed
Fix the size argument
1 parent a11c0d9 commit c69b65f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/_ctypes/cfield.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ Py_ssize_t NUM_BITS(Py_ssize_t bitsize) {
393393
return NULL; \
394394
} \
395395
} \
396-
*(CTYPE*)ptr = SET(CTYPE, *(CTYPE*)ptr, val, (NBITS) / 8); \
396+
*(CTYPE*)ptr = SET(CTYPE, *(CTYPE*)ptr, val, size_arg); \
397397
_RET(value); \
398398
} \
399399
\
@@ -415,7 +415,7 @@ Py_ssize_t NUM_BITS(Py_ssize_t bitsize) {
415415
TAG ## _set_sw(void *ptr, PyObject *value, Py_ssize_t size_arg) \
416416
{ \
417417
CTYPE val; \
418-
PyObject *res = TAG ## _set(&val, value, size_arg); \
418+
PyObject *res = TAG ## _set(&val, value, (NBITS) / 8); \
419419
if (res == NULL) { \
420420
return NULL; \
421421
} \

0 commit comments

Comments
 (0)