summaryrefslogtreecommitdiffstats
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-06-28 22:07:35 (GMT)
committerGuido van Rossum <guido@python.org>2000-06-28 22:07:35 (GMT)
commit582acece2e0db447904b3f8f8f1d2acf36834158 (patch)
tree80805422d52a32da77e5e93425c34ec48d76a9c6 /Python/traceback.c
parent6f2a5efec98c831bd529dfb341c2f83ff0914418 (diff)
downloadcpython-582acece2e0db447904b3f8f8f1d2acf36834158.zip
cpython-582acece2e0db447904b3f8f8f1d2acf36834158.tar.gz
cpython-582acece2e0db447904b3f8f8f1d2acf36834158.tar.bz2
Trent Mick's Win64 changes: size_t vs. int or long; also some overflow
tests.
Diffstat (limited to 'Python/traceback.c')
-rw-r--r--Python/traceback.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index 0b8157d..d63aef5 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -166,7 +166,7 @@ tb_displayline(f, filename, lineno, name)
path = PySys_GetObject("path");
if (path != NULL && PyList_Check(path)) {
int npath = PyList_Size(path);
- int taillen = strlen(tail);
+ size_t taillen = strlen(tail);
char namebuf[MAXPATHLEN+1];
for (i = 0; i < npath; i++) {
PyObject *v = PyList_GetItem(path, i);
@@ -175,12 +175,12 @@ tb_displayline(f, filename, lineno, name)
break;
}
if (PyString_Check(v)) {
- int len;
+ size_t len;
len = PyString_Size(v);
if (len + 1 + taillen >= MAXPATHLEN)
continue; /* Too long */
strcpy(namebuf, PyString_AsString(v));
- if ((int)strlen(namebuf) != len)
+ if (strlen(namebuf) != len)
continue; /* v contains '\0' */
if (len > 0 && namebuf[len-1] != SEP)
namebuf[len++] = SEP;