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

Display an error if sbbs.ini can't be opened, don't deref NULL pointer

CID 451182
parent 46acf140
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4010 passed
...@@ -46,9 +46,13 @@ void adjust_last_node() ...@@ -46,9 +46,13 @@ void adjust_last_node()
SAFEPRINTF(prompt, "Update Terminal Server 'LastNode' value to %u", cfg.sys_nodes); SAFEPRINTF(prompt, "Update Terminal Server 'LastNode' value to %u", cfg.sys_nodes);
if(last_node < cfg.sys_nodes && uifc.confirm(prompt)) { if(last_node < cfg.sys_nodes && uifc.confirm(prompt)) {
fp = iniOpenFile(ini_fname, /* modify */true); fp = iniOpenFile(ini_fname, /* modify */true);
iniSetUInteger(&ini, section, key, cfg.sys_nodes, NULL); if(fp == NULL)
iniWriteFile(fp, ini); uifc.msgf("Error %d opening %s", errno, ini_fname);
iniCloseFile(fp); else {
iniSetUInteger(&ini, section, key, cfg.sys_nodes, NULL);
iniWriteFile(fp, ini);
iniCloseFile(fp);
}
} }
iniFreeStringList(ini); iniFreeStringList(ini);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment