Commit f50e1877 authored by Victor Stinner's avatar Victor Stinner

Fix compiler warnings: comparison between signed and unsigned numbers

parent 7f04d4d4
......@@ -1738,7 +1738,7 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
return 0;
}
if (PyBytes_GET_SIZE(ctl_name) > sizeof(info.ctl_name)) {
if (PyBytes_GET_SIZE(ctl_name) > (Py_ssize_t)sizeof(info.ctl_name)) {
PyErr_SetString(PyExc_ValueError,
"provided string is too long");
Py_DECREF(ctl_name);
......
......@@ -4799,7 +4799,7 @@ _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size)
/* Note: size will always be longer than the resulting Unicode
character count */
if (PY_SSIZE_T_MAX / sizeof(wchar_t) < (size + 1))
if (PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(wchar_t) < (size + 1))
return NULL;
unicode = PyMem_RawMalloc((size + 1) * sizeof(wchar_t));
if (!unicode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment