Remove Py_SSIZE2SIZE to quiet cppcheck warnings.

Tuple size cannot be negative and we already handle the case where
it is zero.
This commit is contained in:
Todd C. Miller
2021-01-26 11:33:06 -07:00
parent 19d5845f8b
commit bca213959b
4 changed files with 4 additions and 4 deletions

View File

@@ -212,7 +212,7 @@ py_str_array_from_tuple(PyObject *py_tuple)
Py_ssize_t tuple_size = PyTuple_Size(py_tuple);
// we need an extra 0 at the end
char **result = calloc(Py_SSIZE2SIZE(tuple_size) + 1, sizeof(char*));
char **result = calloc(tuple_size + 1, sizeof(char *));
if (result == NULL) {
debug_return_ptr(NULL);
}