Skip to content

Commit 87ab5aa

Browse files
authored
Update posixmodule.c
1 parent ca05143 commit 87ab5aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/posixmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4189,8 +4189,8 @@ posix_getcwd(int use_bytes)
41894189
/* If the buffer is large enough, len does not include the
41904190
terminating \0. If the buffer is too small, len includes
41914191
the space needed for the terminator. */
4192-
if ((size_t)len >= Py_ARRAY_LENGTH(wbuf)) {
4193-
if (len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) {
4192+
if (len >= Py_ARRAY_LENGTH(wbuf)) {
4193+
if ((Py_ssize_t)len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) {
41944194
wbuf2 = PyMem_RawMalloc(len * sizeof(wchar_t));
41954195
}
41964196
else {

0 commit comments

Comments
 (0)