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

Updated for new load_cfg() prototype and scfg_t.size field.

parent 3fec1a49
Branches
Tags
No related merge requests found
......@@ -1510,7 +1510,8 @@ void __fastcall TMainForm::StartupTimerTick(TObject *Sender)
if(CtrlDirectory.UpperCase().AnsiPos("MAIN.CNF"))
CtrlDirectory.SetLength(CtrlDirectory.Length()-8);
strcpy(cfg.ctrl_dir,CtrlDirectory.c_str());
if(!load_cfg(&cfg, NULL)) {
cfg.size=sizeof(cfg);
if(!load_cfg(&cfg, NULL, TRUE)) {
Application->MessageBox("Failed to load configuration files.","ERROR"
,MB_OK|MB_ICONEXCLAMATION);
Application->Terminate();
......
......@@ -4109,7 +4109,8 @@ void DLLCALL ftp_server(void* arg)
sprintf(scfg.ctrl_dir, "%.*s",(int)sizeof(scfg.ctrl_dir)-1
,startup->ctrl_dir);
lprintf("Loading configuration files from %s", scfg.ctrl_dir);
if(!load_cfg(&scfg, NULL)) {
scfg.size=sizeof(scfg);
if(!load_cfg(&scfg, NULL, TRUE)) {
lprintf("!Failed to load configuration files");
cleanup(1);
return;
......
......@@ -2380,7 +2380,8 @@ void DLLCALL mail_server(void* arg)
sprintf(scfg.ctrl_dir, "%.*s", (int)sizeof(scfg.ctrl_dir)-1
,startup->ctrl_dir);
lprintf("Loading configuration files from %s", scfg.ctrl_dir);
if(!load_cfg(&scfg, NULL)) {
scfg.size=sizeof(scfg);
if(!load_cfg(&scfg, NULL, TRUE)) {
lprintf("!Failed to load configuration files");
cleanup(1);
return;
......
......@@ -2989,8 +2989,9 @@ void DLLCALL bbs_thread(void* arg)
sprintf(scfg.ctrl_dir, "%.*s", (int)sizeof(scfg.ctrl_dir)-1
,startup->ctrl_dir);
lprintf("Loading configuration files from %s", scfg.ctrl_dir);
scfg.size=sizeof(scfg);
scfg.node_num=startup->first_node;
if(!load_cfg(&scfg, text)) {
if(!load_cfg(&scfg, text, TRUE)) {
lprintf("!Failed to load configuration files");
cleanup(1);
return;
......@@ -3263,7 +3264,7 @@ void DLLCALL bbs_thread(void* arg)
lprintf("Loading configuration files from %s", scfg.ctrl_dir);
scfg.node_num=first_node;
pthread_mutex_lock(&event_mutex);
if(!load_cfg(&scfg, text)) {
if(!load_cfg(&scfg, text, TRUE)) {
lprintf("!Failed to load configuration files");
break;
}
......
......@@ -754,7 +754,7 @@ extern "C" {
/* load_cfg.c */
DLLEXPORT BOOL DLLCALL load_cfg(scfg_t* cfg, char* text[]);
DLLEXPORT BOOL DLLCALL load_cfg(scfg_t* cfg, char* text[], BOOL prep);
DLLEXPORT void DLLCALL free_cfg(scfg_t* cfg);
DLLEXPORT void DLLCALL free_text(char* text[]);
......
......@@ -3909,7 +3909,8 @@ int main(int argc, char **argv)
printf("!ERROR changing directory to: %s", scfg.ctrl_dir);
printf("\nLoading configuration files from %s\n", scfg.ctrl_dir);
if(!load_cfg(&scfg, NULL)) {
scfg.size=sizeof(scfg);
if(!load_cfg(&scfg, NULL, TRUE)) {
printf("!Failed to load configuration files\n");
bail(1);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment