summaryrefslogtreecommitdiff
path: root/src/core/settings.c
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2016-06-13 14:03:00 +0200
committerLemonBoy <thatlemon@gmail.com>2016-06-13 14:03:00 +0200
commit9a30ab53df226acb4586a2f214f3994a7b8b32ea (patch)
tree60853f484c23b0accffa5befec474789ae685b7f /src/core/settings.c
parent6f795f020d5c374023dc9ca647b267aef0a76950 (diff)
downloadirssi-9a30ab53df226acb4586a2f214f3994a7b8b32ea.zip
Move the validation of the CHOICE setting value
Also, use a FORMAT to show the error message.
Diffstat (limited to 'src/core/settings.c')
-rw-r--r--src/core/settings.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/settings.c b/src/core/settings.c
index 8509a9ff..0716103a 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -387,15 +387,11 @@ gboolean settings_set_choice(const char *key, const char *value)
rec = settings_get_record(key);
- if (rec != NULL && strarray_find(rec->choices, value) < 0) {
- char *msg = g_strjoinv(",", rec->choices);
- g_warning("Invalid value for '%s', must be one of: %s", key, msg);
- g_free(msg);
-
+ if (rec != NULL && strarray_find(rec->choices, value) < 0)
return FALSE;
- }
settings_set_str(key, value);
+
return TRUE;
}