Skip to content

Commit 0486904

Browse files
committed
Bug #4495: Fix signed/unsigned warning (both namelen and tailen should be signed, not just namelen).
1 parent 5b78dd9 commit 0486904

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/traceback.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ _Py_FindSourceFile(const char* filename, char* namebuf, size_t namelen, int open
171171
if (!PyUnicode_Check(v))
172172
continue;
173173
path = _PyUnicode_AsStringAndSize(v, &len);
174-
if (len + 1 + taillen >= (Py_ssize_t)namelen - 1)
174+
if (len + 1 + (Py_ssize_t)taillen >= (Py_ssize_t)namelen - 1)
175175
continue; /* Too long */
176176
strcpy(namebuf, path);
177177
if (strlen(namebuf) != len)

0 commit comments

Comments
 (0)