diff options
author | LemonBoy <thatlemon@gmail.com> | 2016-06-13 14:03:00 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2016-06-13 14:03:00 +0200 |
commit | 9a30ab53df226acb4586a2f214f3994a7b8b32ea (patch) | |
tree | 60853f484c23b0accffa5befec474789ae685b7f /src/core/settings.c | |
parent | 6f795f020d5c374023dc9ca647b267aef0a76950 (diff) | |
download | irssi-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.c | 8 |
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; } |