Commit 7ce2d50c authored by Rob Swindell's avatar Rob Swindell 💬
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 662434bf
Pipeline #3251 passed with stage
in 5 minutes and 29 seconds
......@@ -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));
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));
......@@ -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);
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