Commit 1012c49e authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Timed event month-days (mdays) is 32-bit, not 16

Fix issue #470 reported via IRC: timed event "mdays" values were read and written as 16-bit values, meaning any setting for days > 15 would do weird things.
parent d83f1507
Pipeline #3566 passed with stage
in 6 minutes and 11 seconds
......@@ -550,7 +550,7 @@ BOOL read_xtrn_cfg(scfg_t* cfg, char* error, size_t maxerrlen)
cfg->event[i]->misc = iniGetInt32(section, NULL, "settings", 0);
SAFECOPY(cfg->event[i]->dir, iniGetString(section, NULL, "startup_dir", "", value));
cfg->event[i]->freq = iniGetShortInt(section, NULL, "freq", 0);
cfg->event[i]->mdays = iniGetShortInt(section, NULL, "mdays", 0);
cfg->event[i]->mdays = iniGetUInt32(section, NULL, "mdays", 0);
cfg->event[i]->months = iniGetShortInt(section, NULL, "months", 0);
cfg->event[i]->errlevel = (uint8_t)iniGetShortInt(section, NULL, "errlevel", LOG_ERR);
......
......@@ -954,7 +954,7 @@ BOOL write_xtrn_cfg(scfg_t* cfg, int backup_level)
iniSetHexInt(&section, name, "settings", cfg->event[i]->misc, NULL);
iniSetString(&section, name, "startup_dir", cfg->event[i]->dir, NULL);
iniSetShortInt(&section, name, "freq", cfg->event[i]->freq, NULL);
iniSetShortInt(&section, name, "mdays", cfg->event[i]->mdays, NULL);
iniSetHexInt(&section, name, "mdays", cfg->event[i]->mdays, NULL);
iniSetShortInt(&section, name, "months", cfg->event[i]->months, NULL);
iniSetShortInt(&section, name, "errlevel", cfg->event[i]->errlevel, NULL);
strListMerge(&ini, section);
......
Supports Markdown
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