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

BadFilename text.dat string is now a format string

(prints the bad filename)
- also, checkfname() is going to do the file.can (trashcan) checking, so no need here
parent b417647b
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -130,7 +130,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode, ...@@ -130,7 +130,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode,
if(mode&WM_FILE) { if(mode&WM_FILE) {
if(!checkfname(title)) { if(!checkfname(title)) {
bputs(text[BadFilename]); bprintf(text[BadFilename], title);
(void)remove(msgpath); (void)remove(msgpath);
return(false); return(false);
} }
......
...@@ -276,10 +276,9 @@ bool sbbs_t::upload(uint dirnum) ...@@ -276,10 +276,9 @@ bool sbbs_t::upload(uint dirnum)
f.dir=curdirnum=dirnum; f.dir=curdirnum=dirnum;
bputs(text[Filename]); bputs(text[Filename]);
if(getstr(fname, sizeof(fname) - 1, 0) < 1 || strchr(fname,'?') || strchr(fname,'*') if(getstr(fname, sizeof(fname) - 1, 0) < 1 || strchr(fname,'?') || strchr(fname,'*') || !checkfname(fname)) {
|| !checkfname(fname) || (trashcan(fname,"file") && !dir_op(dirnum))) {
if(fname[0]) if(fname[0])
bputs(text[BadFilename]); bprintf(text[BadFilename], fname);
return(false); return(false);
} }
if(dirnum==cfg.sysop_dir) if(dirnum==cfg.sysop_dir)
......
...@@ -486,7 +486,7 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, long mode, ...@@ -486,7 +486,7 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, long mode,
} }
if((mode&WM_FILE) && !checkfname(subj)) { if((mode&WM_FILE) && !checkfname(subj)) {
free(buf); free(buf);
bputs(text[BadFilename]); bprintf(text[BadFilename], subj);
return(false); return(false);
} }
if(!(mode&(WM_EMAIL|WM_NETMAIL)) && cfg.sub[subnum]->misc&SUB_QNET if(!(mode&(WM_EMAIL|WM_NETMAIL)) && cfg.sub[subnum]->misc&SUB_QNET
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment