summaryrefslogtreecommitdiff
path: root/Python/import.c
diff options
context:
space:
mode:
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 8f8341038b..d201dae54f 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);