mirror of
https://github.com/He4eT/dice.git
synced 2026-05-05 01:47:25 +00:00
c: validate the upper_bound
This commit is contained in:
parent
d43b063de8
commit
92c13caa08
1 changed files with 4 additions and 0 deletions
|
|
@ -73,6 +73,10 @@ static void prv_load_settings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prv_save_settings() {
|
static void prv_save_settings() {
|
||||||
|
if (settings.upper_bound < 1) {
|
||||||
|
settings.upper_bound = 1;
|
||||||
|
}
|
||||||
|
|
||||||
persist_write_data(SETTINGS_KEY, &settings, sizeof(settings));
|
persist_write_data(SETTINGS_KEY, &settings, sizeof(settings));
|
||||||
current_number = settings.upper_bound;
|
current_number = settings.upper_bound;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue