Commit 4dbe1a1b authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

load_cfg() now requires the size of the error string buffer passed as argument

parent 5e0f2ad6
Pipeline #1155 failed with stage
in 22 minutes and 38 seconds
......@@ -76,7 +76,7 @@ void refresh_events(void)
/* Read .cfg files here */
free_cfg(&cfg);
if(!load_cfg(&cfg, NULL, TRUE, str)) {
if(!load_cfg(&cfg, NULL, TRUE, str, sizeof(str))) {
char error[256];
SAFEPRINTF(error, "ERROR Loading Configuration Files: %s", str);
display_message("Load Error",error,"gtk-dialog-error");
......
......@@ -90,7 +90,7 @@ int refresh_globals(void)
}
/* Read .cfg files here */
if(!load_cfg(&cfg, NULL, TRUE, str)) {
if(!load_cfg(&cfg, NULL, TRUE, str, sizeof(str))) {
fprintf(stderr,"Cannot load configuration data: %s\n", str);
return(-1);
}
......
......@@ -39,7 +39,7 @@ int main(int argc, char **argv)
}
cfg.size=sizeof(cfg);
if(!load_cfg(&cfg, NULL, TRUE, str)) {
if(!load_cfg(&cfg, NULL, TRUE, str, sizeof(str))) {
fprintf(stderr,"Cannot load configuration data (%s)",str);
return(-1);
}
......
......@@ -496,7 +496,7 @@ void status_thread(void *arg)
lprintf(LOG_INFO,"Loading configuration files from %s", scfg.ctrl_dir);
scfg.size=sizeof(scfg);
SAFECOPY(error,UNKNOWN_LOAD_ERROR);
if(!load_cfg(&scfg, NULL, TRUE, error)) {
if(!load_cfg(&scfg, NULL, TRUE, error, sizeof(error))) {
lprintf(LOG_CRIT,"!ERROR %s",error);
lprintf(LOG_CRIT,"!Failed to load configuration files");
return;
......
......@@ -1945,7 +1945,7 @@ int main(int argc, char** argv) {
memset(&cfg,0,sizeof(cfg));
cfg.size=sizeof(cfg);
SAFECOPY(cfg.ctrl_dir,bbs_startup.ctrl_dir);
if(!load_cfg(&cfg, NULL, TRUE, str)) {
if(!load_cfg(&cfg, NULL, TRUE, str, sizeof(str))) {
printf("ERROR! %s\n",str);
exit(1);
}
......
......@@ -892,7 +892,7 @@ int main(int argc, char** argv) {
memset(&cfg,0,sizeof(cfg));
cfg.size=sizeof(cfg);
SAFECOPY(cfg.ctrl_dir,bbs_startup.ctrl_dir);
if(!load_cfg(&cfg, NULL, TRUE, str)) {
if(!load_cfg(&cfg, NULL, TRUE, str, sizeof(str))) {
printf("ERROR! %s\n",str);
exit(1);
}
......
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