Fixed a crash bug when keep_backup() calls make_file() and the lastdir

pointer is no longer valid.
This commit is contained in:
Wayne Davison
2004-02-11 02:48:58 +00:00
parent 65d6212d03
commit 7de2483fbd

View File

@@ -731,6 +731,8 @@ struct file_struct *make_file(char *fname,
char *basename, *dirname, *bp;
unsigned short flags = 0;
if (!flist) /* lastdir isn't valid if flist is NULL */
lastdir_len = -1;
if (strlcpy(thisname, fname, sizeof thisname)
>= sizeof thisname - flist_dir_len) {