Use MAX_PATH in write_file strncpy (for now) instead of 132
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@408 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
7960dcf919
commit
b04a98dc86
|
@ -14,6 +14,8 @@ General
|
||||||
- Change open call flags, basically copy joe's way of doing it so
|
- Change open call flags, basically copy joe's way of doing it so
|
||||||
a more recent version will actually be included in (un)stable.
|
a more recent version will actually be included in (un)stable.
|
||||||
- Remove useless fstat call.
|
- Remove useless fstat call.
|
||||||
|
- Use MAX_PATH instead of static 132 for strncpy, at least until
|
||||||
|
we no longer use MAX_PATH.
|
||||||
open_file()
|
open_file()
|
||||||
- Added check for S_ISBLK and S_ISCHR, don't open device files!
|
- Added check for S_ISBLK and S_ISCHR, don't open device files!
|
||||||
- nano.c:
|
- nano.c:
|
||||||
|
|
2
files.c
2
files.c
|
@ -472,7 +472,7 @@ int write_file(char *name, int tmp)
|
||||||
mask, realname, strerror(errno));
|
mask, realname, strerror(errno));
|
||||||
|
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
strncpy(filename, realname, 132);
|
strncpy(filename, realname, PATH_MAX - 1);
|
||||||
statusbar(_("Wrote %d lines"), lineswritten);
|
statusbar(_("Wrote %d lines"), lineswritten);
|
||||||
UNSET(MODIFIED);
|
UNSET(MODIFIED);
|
||||||
titlebar();
|
titlebar();
|
||||||
|
|
Loading…
Reference in New Issue