[gnome-control-center] Initialize variable to avoid using uninitialized memory later
- From: Kjartan Maraas <kmaraas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Initialize variable to avoid using uninitialized memory later
- Date: Wed, 2 Mar 2011 19:07:10 +0000 (UTC)
commit ab453dc044f68a816f42859592a67b0acff8a75f
Author: Kjartan Maraas <kmaraas gnome org>
Date: Thu Feb 24 19:52:47 2011 +0100
Initialize variable to avoid using uninitialized memory later
panels/sound/gvc-mixer-control.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/panels/sound/gvc-mixer-control.c b/panels/sound/gvc-mixer-control.c
index 0635e63..5a90db4 100644
--- a/panels/sound/gvc-mixer-control.c
+++ b/panels/sound/gvc-mixer-control.c
@@ -615,13 +615,13 @@ static void
update_default_source_from_name (GvcMixerControl *control,
const char *name)
{
- gboolean changed;
+ gboolean changed = FALSE;
if ((control->priv->default_source_name == NULL
&& name != NULL)
|| (control->priv->default_source_name != NULL
&& name == NULL)
- || strcmp (control->priv->default_source_name, name) != 0) {
+ || (name != NULL && strcmp (control->priv->default_source_name, name) != 0)) {
changed = TRUE;
}
@@ -640,13 +640,13 @@ static void
update_default_sink_from_name (GvcMixerControl *control,
const char *name)
{
- gboolean changed;
+ gboolean changed = FALSE;
if ((control->priv->default_sink_name == NULL
&& name != NULL)
|| (control->priv->default_sink_name != NULL
&& name == NULL)
- || strcmp (control->priv->default_sink_name, name) != 0) {
+ || (name != NULL && strcmp (control->priv->default_sink_name, name) != 0)) {
changed = TRUE;
}
@@ -1125,7 +1125,7 @@ update_card (GvcMixerControl *control,
const pa_card_info *info)
{
GvcMixerCard *card;
- gboolean is_new;
+ gboolean is_new = FALSE;
#if 1
guint i;
const char *key;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]