[Python-3000-checkins] r61770 - python/branches/py3k/Python/import.c

martin.v.loewis python-3000-checkins at python.org
Sat Mar 22 23:07:13 CET 2008


Author: martin.v.loewis
Date: Sat Mar 22 23:07:13 2008
New Revision: 61770

Modified:
   python/branches/py3k/Python/import.c
Log:
Properly terminate file name.


Modified: python/branches/py3k/Python/import.c
==============================================================================
--- python/branches/py3k/Python/import.c	(original)
+++ python/branches/py3k/Python/import.c	Sat Mar 22 23:07:13 2008
@@ -997,7 +997,7 @@
 	}
 
 	strncpy(py, file, len-1);
-	py[len] = '\0';
+	py[len-1] = '\0';
 	if (stat(py, &statbuf) == 0 &&
 		S_ISREG(statbuf.st_mode)) {
 		u = PyUnicode_DecodeFSDefault(py);


More information about the Python-3000-checkins mailing list