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

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

Fixes issue #395
parent f6397e73
No related branches found
No related tags found
No related merge requests found
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment