Commit 2cf42b0c authored by rswindell's avatar rswindell
Browse files

No longer calls closedir with NULL pointer if opendir fails.

parent b7f86da3
......@@ -642,7 +642,8 @@ void sbbs_t::batch_upload()
uploadfile(&f);
}
}
closedir(dir);
if(dir!=NULL)
closedir(dir);
}
/****************************************************************************/
......
......@@ -494,7 +494,8 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
if(!mv(str,tmp2,1))
netfiles++;
}
closedir(dir);
if(dir!=NULL)
closedir(dir);
if(netfiles)
CRLF; }
......@@ -616,7 +617,8 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
if(!isdir(tmp))
remove(tmp);
}
closedir(dir);
if(dir!=NULL)
closedir(dir);
}
return(true);
......
......@@ -311,7 +311,8 @@ void sbbs_t::extract(uint dirnum)
if(!isdir(str))
remove(str);
}
closedir(dir);
if(dir!=NULL)
closedir(dir);
CRLF;
}
}
......
......@@ -425,7 +425,8 @@ bool sbbs_t::unpack_rep(char* repfile)
sprintf(str,text[ReceivedFileViaQWK],dirent->d_name,useron.alias);
putsmsg(&cfg,1,str);
}
closedir(dir);
if(dir!=NULL)
closedir(dir);
sprintf(str,"%sqnet-rep.now",cfg.data_dir);
if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
......
......@@ -579,7 +579,8 @@ bool sbbs_t::bulkupload(uint dirnum)
uploadfile(&f);
}
}
closedir(dir);
if(dir!=NULL)
closedir(dir);
if(sys_status&SS_ABORT)
return(true);
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