Make sure file_name contains '/' between SAVEDIR and the file name.
Duplicated slashes are not a problem. Missing slashes are.
This commit is contained in:
parent
5a25cd89da
commit
1f1ae55a26
4 changed files with 4 additions and 4 deletions
|
|
@ -64,7 +64,7 @@ char **envp;
|
|||
use_savedir = TRUE;
|
||||
strncpy(whoami, argv[2], LINELEN);
|
||||
whoami[LINELEN - 1] = '\0';
|
||||
if (snprintf(file_name, LINELEN, "%s%d-%.10s.ar5sav", SAVEDIR,
|
||||
if (snprintf(file_name, LINELEN, "%s/%d-%.10s.ar5sav", SAVEDIR,
|
||||
md_getuid(), whoami) >= LINELEN)
|
||||
{
|
||||
/* The name is too long */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue