bpo-36352: Avoid hardcoded MAXPATHLEN size in getpath.c (GH-12423)

* Use Py_ARRAY_LENGTH() rather than hardcoded MAXPATHLEN in getpath.c.
* Pass string length to functions modifying strings.
This commit is contained in:
Victor Stinner 2019-03-19 02:58:14 +01:00 committed by GitHub
parent 5f9cf23502
commit faddaedd05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 247 additions and 159 deletions

View file

@ -1716,7 +1716,7 @@ _Py_wrealpath(const wchar_t *path,
}
#endif
/* Get the current directory. size is the buffer size in wide characters
/* Get the current directory. buflen is the buffer size in wide characters
including the null character. Decode the path from the locale encoding.
Return NULL on getcwd() error, on decoding error, or if 'buf' is