summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2014-11-01 23:24:45 +0300
committermonsta <[email protected]>2014-11-01 23:24:45 +0300
commitbe848eb10a716df13bf4dc6af9239b4e4143623c (patch)
tree6836f0d3e2a11f315e4c08094a122e1038111d13
parentcededb5aec8b2dc6aea20c712555729cdb59317d (diff)
downloadmate-media-be848eb10a716df13bf4dc6af9239b4e4143623c.tar.bz2
mate-media-be848eb10a716df13bf4dc6af9239b4e4143623c.tar.xz
init vars properly, use safer string compare function
g_strcmp0 on two NULLs gives 0, so the logic is preserved here
-rw-r--r--mate-volume-control/src/gvc-mixer-control.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mate-volume-control/src/gvc-mixer-control.c b/mate-volume-control/src/gvc-mixer-control.c
index 4d69e27..e587c8f 100644
--- a/mate-volume-control/src/gvc-mixer-control.c
+++ b/mate-volume-control/src/gvc-mixer-control.c
@@ -533,13 +533,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) {
+ || g_strcmp0 (control->priv->default_source_name, name) != 0) {
changed = TRUE;
}
@@ -558,13 +558,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) {
+ || g_strcmp0 (control->priv->default_sink_name, name) != 0) {
changed = TRUE;
}