mirror of
https://github.com/python/cpython.git
synced 2025-12-11 11:31:05 +00:00
Use size_t instead of int for a PyMem_MALLOC argument; silences a gcc 'comparison always false' warning.
This commit is contained in:
parent
b4d286d04e
commit
8504d085b7
1 changed files with 1 additions and 1 deletions
|
|
@ -197,7 +197,7 @@ PyCapsule_Import(const char *name, int no_block)
|
||||||
PyObject *object = NULL;
|
PyObject *object = NULL;
|
||||||
void *return_value = NULL;
|
void *return_value = NULL;
|
||||||
char *trace;
|
char *trace;
|
||||||
int name_length = (strlen(name) + 1) * sizeof(char);
|
size_t name_length = (strlen(name) + 1) * sizeof(char);
|
||||||
char *name_dup = (char *)PyMem_MALLOC(name_length);
|
char *name_dup = (char *)PyMem_MALLOC(name_length);
|
||||||
|
|
||||||
if (!name_dup) {
|
if (!name_dup) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue