Skip to content
Snippets Groups Projects
Commit 980dad23 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 dd34bb37
No related branches found
No related tags found
No related merge requests found
......@@ -46,9 +46,13 @@ void adjust_last_node()
SAFEPRINTF(prompt, "Update Terminal Server 'LastNode' value to %u", cfg.sys_nodes);
if(last_node < cfg.sys_nodes && uifc.confirm(prompt)) {
fp = iniOpenFile(ini_fname, /* modify */true);
iniSetUInteger(&ini, section, key, cfg.sys_nodes, NULL);
iniWriteFile(fp, ini);
iniCloseFile(fp);
if(fp == NULL)
uifc.msgf("Error %d opening %s", errno, ini_fname);
else {
iniSetUInteger(&ini, section, key, cfg.sys_nodes, NULL);
iniWriteFile(fp, ini);
iniCloseFile(fp);
}
}
iniFreeStringList(ini);
}
......
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