diff Python/traceback.c @ 13096:8c8de5b736dc legacy-trunk

Trent Mick's Win64 changes: size_t vs. int or long; also some overflow tests.
author Guido van Rossum <guido@python.org>
date Wed, 28 Jun 2000 22:07:35 +0000
parents 1c7c2dd1beb1
children 916fb024ce94
line wrap: on
line diff
--- a/Python/traceback.c	Wed Jun 28 22:05:44 2000 +0000
+++ b/Python/traceback.c	Wed Jun 28 22:07:35 2000 +0000
@@ -166,7 +166,7 @@
 		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 @@
 					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;