summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-15 16:33:43 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-15 16:33:43 (GMT)
commit2384714819751e975f3ee8c5b57ab1f702e25cac (patch)
treed1f4f04dec588bdc17c71f16a612790e0e7afc0a /Python/sysmodule.c
parent2f5bbc6a123dfb36ed1f89e9016ec356695bdd8a (diff)
downloadcpython-2384714819751e975f3ee8c5b57ab1f702e25cac.zip
cpython-2384714819751e975f3ee8c5b57ab1f702e25cac.tar.gz
cpython-2384714819751e975f3ee8c5b57ab1f702e25cac.tar.bz2
sysmodule.c: fix sys_update_path(), use Py_ARRAY_LENGTH() to get the size of
the fullpath buffer, not PATH_MAX. fullpath is declared using MAXPATHLEN or MAX_PATH depending on the OS, and PATH_MAX is not declared on IRIX.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 1a41d2f..df9dfb1 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1895,7 +1895,7 @@ sys_update_path(int argc, wchar_t **argv)
#else /* All other filename syntaxes */
if (_HAVE_SCRIPT_ARGUMENT(argc, argv)) {
#if defined(HAVE_REALPATH)
- if (_Py_wrealpath(argv0, fullpath, PATH_MAX)) {
+ if (_Py_wrealpath(argv0, fullpath, Py_ARRAY_LENGTH(fullpath))) {
argv0 = fullpath;
}
#endif