]> granicus.if.org Git - python/commitdiff
Issue #9566: Fix compiler warning on Windows 64-bit
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 4 Jun 2013 22:46:29 +0000 (00:46 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 4 Jun 2013 22:46:29 +0000 (00:46 +0200)
Python/fileutils.c

index bb0cd4350096441b679994817879e1bde03f8791..293cb77f55997a1b76f078c9639e8e0bd80b8fc8 100644 (file)
@@ -707,7 +707,8 @@ wchar_t*
 _Py_wgetcwd(wchar_t *buf, size_t size)
 {
 #ifdef MS_WINDOWS
-    return _wgetcwd(buf, size);
+    int isize = (int)Py_MIN(size, INT_MAX);
+    return _wgetcwd(buf, isize);
 #else
     char fname[PATH_MAX];
     wchar_t *wname;