Properly terminate file name.

This commit is contained in:
Martin v. Löwis 2008-03-22 22:07:13 +00:00
parent da9968371e
commit 5021ebc892
1 changed files with 1 additions and 1 deletions

View File

@ -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);