summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-03-22 22:07:13 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-03-22 22:07:13 (GMT)
commit5021ebc892ebc831cf3ec5b9de2c70717a08b074 (patch)
treee3cb4c648d950a4889a4ad0b5b8779dbc1c9d935 /Python/import.c
parentda9968371ebc6de73ac6a640aeb062abae9ac59f (diff)
downloadcpython-5021ebc892ebc831cf3ec5b9de2c70717a08b074.zip
cpython-5021ebc892ebc831cf3ec5b9de2c70717a08b074.tar.gz
cpython-5021ebc892ebc831cf3ec5b9de2c70717a08b074.tar.bz2
Properly terminate file name.
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 8f83410..d201dae 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -997,7 +997,7 @@ get_sourcefile(const char *file)
}
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);