]> granicus.if.org Git - python/commitdiff
Bug #4495: Fix signed/unsigned warning (both namelen and tailen should be signed...
authorRaymond Hettinger <python@rcn.com>
Tue, 2 Dec 2008 20:59:48 +0000 (20:59 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 2 Dec 2008 20:59:48 +0000 (20:59 +0000)
Python/traceback.c

index 63ecc3cb16e4329c755374db2de203633cbc7d11..42bbd538e23886404f79c0c65a3e75ee9c5f5da2 100644 (file)
@@ -171,7 +171,7 @@ _Py_FindSourceFile(const char* filename, char* namebuf, size_t namelen, int open
                if (!PyUnicode_Check(v))
                        continue;
                path = _PyUnicode_AsStringAndSize(v, &len);
-               if (len + 1 + taillen >= (Py_ssize_t)namelen - 1)
+               if (len + 1 + (Py_ssize_t)taillen >= (Py_ssize_t)namelen - 1)
                        continue; /* Too long */
                strcpy(namebuf, path);
                if (strlen(namebuf) != len)