mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
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.
This commit is contained in:
parent
e740c5b4cd
commit
59bdba3cbb
@ -293,6 +293,13 @@ gsettings_set (GSettings *settings,
|
|||||||
exit (1);
|
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_settings_set_value (settings, key, new);
|
||||||
g_variant_unref (existing);
|
g_variant_unref (existing);
|
||||||
g_variant_unref (new);
|
g_variant_unref (new);
|
||||||
|
Loading…
Reference in New Issue
Block a user