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

Truncate node.dab to correct size when initializing any sbbs_t instance

Fixes issue #395
parent 07503ac3
Pipeline #2990 passed with stage
in 9 minutes and 45 seconds
......@@ -3546,6 +3546,8 @@ bool sbbs_t::init()
break;
}
}
if(chsize(nodefile, (off_t)(cfg.sys_nodes*sizeof(node_t))) != 0)
errormsg(WHERE, ERR_LEN, str, cfg.sys_nodes*sizeof(node_t));
for(i=0; cfg.node_num>0 && i<LOOP_NODEDAB; i++) {
if(lock(nodefile,(cfg.node_num-1)*sizeof(node_t),sizeof(node_t))==0) {
unlock(nodefile,(cfg.node_num-1)*sizeof(node_t),sizeof(node_t));
......
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