diff --git a/ChangeLog b/ChangeLog index 0dbd2356dd161fa1f57a1779a3d85332cf9dc072..a79f2de7db234dd6db5ae3dad315dc3306ca3c8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,8 @@ General - Change open call flags, basically copy joe's way of doing it so a more recent version will actually be included in (un)stable. - Remove useless fstat call. + - Use MAX_PATH instead of static 132 for strncpy, at least until + we no longer use MAX_PATH. open_file() - Added check for S_ISBLK and S_ISCHR, don't open device files! - nano.c: diff --git a/files.c b/files.c index aa797e1467b634204f65cb973eb659727258ab59..4f556a35a93e6fd3224c642ec4b38b3b9ec3ae70 100644 --- a/files.c +++ b/files.c @@ -472,7 +472,7 @@ int write_file(char *name, int tmp) mask, realname, strerror(errno)); if (!tmp) { - strncpy(filename, realname, 132); + strncpy(filename, realname, PATH_MAX - 1); statusbar(_("Wrote %d lines"), lineswritten); UNSET(MODIFIED); titlebar();