Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8504d08

Browse files
committed
Use size_t instead of int for a PyMem_MALLOC argument; silences a gcc 'comparison always false' warning.
1 parent b4d286d commit 8504d08

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/capsule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ PyCapsule_Import(const char *name, int no_block)
197197
PyObject *object = NULL;
198198
void *return_value = NULL;
199199
char *trace;
200-
int name_length = (strlen(name) + 1) * sizeof(char);
200+
size_t name_length = (strlen(name) + 1) * sizeof(char);
201201
char *name_dup = (char *)PyMem_MALLOC(name_length);
202202

203203
if (!name_dup) {

0 commit comments

Comments
 (0)