Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit cb12ed0d authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Fix use of uninitialized variable in editfilename()

CID 331582
parent 9706a821
Pipeline #2206 passed with stage
in 8 minutes and 25 seconds
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment