From 59bdba3cbb50274b906740d483f049cdc91eb928 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Mon, 4 Oct 2010 03:40:22 -0400 Subject: [PATCH] gsettings-tool: implement range-checking Prevent assertion messages from spewing forth and also ensure that we exit with an error status in the event that the value was out of range. Bug #631264. --- gio/gsettings-tool.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gio/gsettings-tool.c b/gio/gsettings-tool.c index e35dd37..c751eeb 100644 --- a/gio/gsettings-tool.c +++ b/gio/gsettings-tool.c @@ -293,6 +293,13 @@ gsettings_set (GSettings *settings, exit (1); } + if (!g_settings_range_check (settings, key, new)) + { + g_printerr ("The provided value is outside of the valid range\n"); + g_variant_unref (new); + exit (1); + } + g_settings_set_value (settings, key, new); g_variant_unref (existing); g_variant_unref (new); -- 2.7.4