Skip to content
Snippets Groups Projects
Commit bb82ddcb authored by rswindell's avatar rswindell
Browse files

Eliminated duplicate function: gettotalfiles()

parent 3c9e03fc
Branches
Tags
No related merge requests found
......@@ -153,18 +153,6 @@ int sbbs_t::getuserxfers(int fromuser, int destuser, char *fname)
return(found);
}
/****************************************************************************/
/* Returns the number of files in the database for 'dir' */
/****************************************************************************/
uint sbbs_t::gettotalfiles(uint dirnum)
{
char str[81];
sprintf(str,"%s%s.ixb", cfg.dir[dirnum]->data_dir, cfg.dir[dirnum]->code);
return((uint)(flength(str)/F_IXBSIZE));
}
/****************************************************************************/
/* Fills the timeleft variable with the correct value. Hangs up on the */
/* user if their time is up. */
......
......@@ -277,7 +277,7 @@ int sbbs_t::exec_file(csi_t *csi)
bputs(text[CantUploadHere]);
return(0); }
if(gettotalfiles(i)>=cfg.dir[i]->maxfiles)
if(getfiles(&cfg,i)>=cfg.dir[i]->maxfiles)
bputs(text[DirFull]);
else {
upload(i);
......@@ -288,7 +288,7 @@ int sbbs_t::exec_file(csi_t *csi)
if(cfg.user_dir==INVALID_DIR) {
bputs(text[NoUserDir]);
return(0); }
if(gettotalfiles(cfg.user_dir)>=cfg.dir[cfg.user_dir]->maxfiles)
if(getfiles(&cfg,cfg.user_dir)>=cfg.dir[cfg.user_dir]->maxfiles)
bputs(text[UserDirFull]);
else if(useron.rest&FLAG('U'))
bputs(text[R_Upload]);
......@@ -303,7 +303,7 @@ int sbbs_t::exec_file(csi_t *csi)
if(cfg.sysop_dir==INVALID_DIR) {
bputs(text[NoSysopDir]);
return(0); }
if(gettotalfiles(cfg.sysop_dir)>=cfg.dir[cfg.sysop_dir]->maxfiles)
if(getfiles(&cfg,cfg.sysop_dir)>=cfg.dir[cfg.sysop_dir]->maxfiles)
bputs(text[DirFull]);
else if(useron.rest&FLAG('U'))
bputs(text[R_Upload]);
......
......@@ -346,7 +346,6 @@ public:
int dir_op(uint dirnum);
int getuserxfers(int fromuser, int destuser, char *fname);
uint gettotalfiles(uint dirnum);
void getnodeext(uint number, char * str);
void putnodeext(uint number, char * str);
void getnodedat(uint number, node_t * node, bool lock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment