From: Raymond Hettinger Date: Tue, 2 Dec 2008 20:59:48 +0000 (+0000) Subject: Bug #4495: Fix signed/unsigned warning (both namelen and tailen should be signed... X-Git-Tag: v3.0~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=048690410f6ad62327e6cde573d6e8b702ea708b;p=thirdparty%2FPython%2Fcpython.git Bug #4495: Fix signed/unsigned warning (both namelen and tailen should be signed, not just namelen). --- diff --git a/Python/traceback.c b/Python/traceback.c index 63ecc3cb16e4..42bbd538e238 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -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)