summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@redhat.com>2013-04-17 10:04:49 +0200
committerStef Walter <stefw@redhat.com>2013-04-17 11:58:43 +0200
commit4608cb6027f4bfe6c7a705d085810e1dc5e25851 (patch)
tree730318120754fd2148a11f5b55c28494c2f11546
parentad61676af0d7103e5672477c50f82beceda7ce85 (diff)
downloadmutter-4608cb6027f4bfe6c7a705d085810e1dc5e25851.tar.gz
Fix use of uninitialized variables
If mutter is going to -Werror by default, then it can play footloose and fancy free with this sorta stuff. https://bugzilla.gnome.org/show_bug.cgi?id=698179
-rw-r--r--src/core/prefs.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 452126451..308b94748 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -1708,12 +1708,13 @@ meta_prefs_set_num_workspaces (int n_workspaces)
{
MetaBasePreference *pref;
- find_pref (preferences_int, sizeof(MetaIntPreference),
- KEY_NUM_WORKSPACES, &pref);
-
- g_settings_set_int (SETTINGS (pref->schema),
- KEY_NUM_WORKSPACES,
- n_workspaces);
+ if (find_pref (preferences_int, sizeof(MetaIntPreference),
+ KEY_NUM_WORKSPACES, &pref))
+ {
+ g_settings_set_int (SETTINGS (pref->schema),
+ KEY_NUM_WORKSPACES,
+ n_workspaces);
+ }
}
static GHashTable *key_bindings;
@@ -2216,9 +2217,11 @@ meta_prefs_set_no_tab_popup (gboolean whether)
{
MetaBasePreference *pref;
- find_pref (preferences_bool, sizeof(MetaBoolPreference),
- KEY_NO_TAB_POPUP, &pref);
- g_settings_set_boolean (SETTINGS (pref->schema), KEY_NO_TAB_POPUP, whether);
+ if (find_pref (preferences_bool, sizeof(MetaBoolPreference),
+ KEY_NO_TAB_POPUP, &pref))
+ {
+ g_settings_set_boolean (SETTINGS (pref->schema), KEY_NO_TAB_POPUP, whether);
+ }
}
int