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

Fix reading and writing of hotkey: sections in xtrn.ini

Section suffix is the decimal ASCII value, not the character itself.
Fix issue #440 as reported by Nelgin
parent 41c447e9
Branches
Tags
No related merge requests found
......@@ -581,7 +581,7 @@ BOOL read_xtrn_cfg(scfg_t* cfg, char* error, size_t maxerrlen)
return allocerr(error, maxerrlen, fname, "hotkey", sizeof(hotkey_t));
memset(cfg->hotkey[i],0,sizeof(hotkey_t));
cfg->hotkey[i]->key = list[i][7];
cfg->hotkey[i]->key = atoi(list[i] + 7);
SAFECOPY(cfg->hotkey[i]->cmd, iniGetString(ini, section, "cmd", "", value));
}
iniFreeStringList(list);
......
......@@ -923,7 +923,7 @@ BOOL write_xtrn_cfg(scfg_t* cfg, int backup_level)
}
for(uint i=0; i<cfg->total_hotkeys; i++) {
SAFEPRINTF(name, "hotkey:%c", cfg->hotkey[i]->key);
SAFEPRINTF(name, "hotkey:%u", cfg->hotkey[i]->key);
iniSetString(&ini, name, "cmd", cfg->hotkey[i]->cmd, NULL);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment