[empathy] tp-account-widgets: use g_strcmp0 instead of strcmp
- From: Marco Barisione <mbari src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] tp-account-widgets: use g_strcmp0 instead of strcmp
- Date: Tue, 20 Aug 2013 11:22:55 +0000 (UTC)
commit df2ff24c6a132e4b6cd40c9f82a24cec8c04a4aa
Author: Marco Barisione <marco barisione collabora co uk>
Date: Mon May 13 10:25:27 2013 +0100
tp-account-widgets: use g_strcmp0 instead of strcmp
There was no bug in this code, but I noticed the usage of strcmp because
of compilation errors caused by some changes to the includes. g_strcmp0
is safer as it handles NULLs.
https://bugzilla.gnome.org/show_bug.cgi?id=699492
tp-account-widgets/tpaw-account-settings.c | 2 +-
tp-account-widgets/tpaw-account-widget.c | 2 +-
tp-account-widgets/tpaw-irc-network-manager.c | 8 ++++----
3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/tp-account-widgets/tpaw-account-settings.c b/tp-account-widgets/tpaw-account-settings.c
index fb91439..8820417 100644
--- a/tp-account-widgets/tpaw-account-settings.c
+++ b/tp-account-widgets/tpaw-account-settings.c
@@ -1538,7 +1538,7 @@ tpaw_account_settings_parameter_is_valid (
g_return_val_if_fail (TPAW_IS_ACCOUNT_SETTINGS (settings), FALSE);
if (g_list_find_custom (settings->priv->required_params, param,
- (GCompareFunc) strcmp))
+ (GCompareFunc) g_strcmp0))
{
/* first, look if it's set in our own parameters */
if (g_hash_table_lookup (settings->priv->parameters, param) != NULL)
diff --git a/tp-account-widgets/tpaw-account-widget.c b/tp-account-widgets/tpaw-account-widget.c
index 2ef43f4..9080d11 100644
--- a/tp-account-widgets/tpaw-account-widget.c
+++ b/tp-account-widgets/tpaw-account-widget.c
@@ -766,7 +766,7 @@ accounts_widget_generic_setup (TpawAccountWidget *self,
gtk_widget_show (widget);
widget = gtk_entry_new ();
- if (strcmp (tp_connection_manager_param_get_name (param),
+ if (g_strcmp0 (tp_connection_manager_param_get_name (param),
"account") == 0)
{
g_signal_connect (widget, "realize",
diff --git a/tp-account-widgets/tpaw-irc-network-manager.c b/tp-account-widgets/tpaw-irc-network-manager.c
index 0b72577..a2c6536 100644
--- a/tp-account-widgets/tpaw-irc-network-manager.c
+++ b/tp-account-widgets/tpaw-irc-network-manager.c
@@ -475,7 +475,7 @@ irc_network_manager_parse_irc_server (TpawIrcNetwork *network,
{
gchar *address = NULL, *port = NULL, *ssl = NULL;
- if (strcmp ((const gchar *) server_node->name, "server") != 0)
+ if (g_strcmp0 ((const gchar *) server_node->name, "server") != 0)
continue;
address = (gchar *) xmlGetProp (server_node, (const xmlChar *) "address");
@@ -494,7 +494,7 @@ irc_network_manager_parse_irc_server (TpawIrcNetwork *network,
if (port_nb <= 0 || port_nb > G_MAXUINT16)
port_nb = 6667;
- if (ssl == NULL || strcmp (ssl, "TRUE") == 0)
+ if (ssl == NULL || g_strcmp0 (ssl, "TRUE") == 0)
have_ssl = TRUE;
DEBUG ("parsed server %s port %d ssl %d", address, port_nb, have_ssl);
@@ -567,7 +567,7 @@ irc_network_manager_parse_irc_network (TpawIrcNetworkManager *self,
if (!str)
continue;
- if (strcmp (tag, "servers") == 0)
+ if (g_strcmp0 (tag, "servers") == 0)
{
irc_network_manager_parse_irc_server (network, child);
}
@@ -753,7 +753,7 @@ find_network_by_address (const gchar *id,
gchar *_address;
g_object_get (server, "address", &_address, NULL);
- found = (_address != NULL && strcmp (address, _address) == 0);
+ found = (_address != NULL && g_strcmp0 (address, _address) == 0);
g_free (_address);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]