diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 8d7131b2eacf95..9046a2c019a8cd 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -4190,7 +4190,7 @@ posix_getcwd(int use_bytes) terminating \0. If the buffer is too small, len includes the space needed for the terminator. */ if (len >= Py_ARRAY_LENGTH(wbuf)) { - if (len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) { + if ((Py_ssize_t)len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) { wbuf2 = PyMem_RawMalloc(len * sizeof(wchar_t)); } else {