Skip to content
Snippets Groups Projects
Commit 76753cf5 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix use of uninitialized variable in editfilename()

CID 331582
parent 61beaec0
No related branches found
No related tags found
No related merge requests found
......@@ -279,7 +279,6 @@ bool sbbs_t::editfilename(file_t* f)
char str[MAX_FILENAME_LEN + 1];
char tmp[MAX_PATH + 1];
char path[MAX_PATH + 1];
char dirpath[MAX_PATH + 1];
bputs(text[EditFilename]);
SAFECOPY(str, f->name);
......@@ -294,8 +293,8 @@ bool sbbs_t::editfilename(file_t* f)
bprintf(text[FileAlreadyThere],path);
return false;
}
SAFEPRINTF2(path,"%s%s",dirpath,f->name);
SAFEPRINTF2(tmp,"%s%s",dirpath,str);
SAFEPRINTF2(path,"%s%s", cfg.dir[f->dir]->path, f->name);
SAFEPRINTF2(tmp,"%s%s", cfg.dir[f->dir]->path, str);
if(fexistcase(path) && rename(path,tmp) != 0) {
bprintf(text[CouldntRenameFile],path,tmp);
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment