summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2015-12-09 16:16:03 +0100
committerLemonBoy <thatlemon@gmail.com>2015-12-09 16:16:03 +0100
commit1749a7a5abf9801bb663b74d4b3e7c3bcbfeb271 (patch)
tree56b57c6ef3271f6ac45d768a83551d4ac8b39539 /src
parent971417caa342881780b347f6aca728d962d710ee (diff)
downloadirssi-1749a7a5abf9801bb663b74d4b3e7c3bcbfeb271.zip
Minor adjustments.
Use g_strcmp0 instead of strcmp. Explicit checks added for the g_strcmp0 clauses.
Diffstat (limited to 'src')
-rw-r--r--src/core/channels-setup.c6
-rw-r--r--src/core/servers-setup.c8
2 files changed, 5 insertions, 9 deletions
diff --git a/src/core/channels-setup.c b/src/core/channels-setup.c
index dd722fea..4966d77d 100644
--- a/src/core/channels-setup.c
+++ b/src/core/channels-setup.c
@@ -37,10 +37,8 @@ static int compare_channel_setup (CONFIG_NODE *node, CHANNEL_SETUP_REC *channel)
name = config_node_get_str(node, "name", NULL);
chatnet = config_node_get_str(node, "chatnet", NULL);
- if (name == NULL || chatnet == NULL)
- return 1;
-
- if (strcmp(name, channel->name) || strcmp(chatnet, channel->chatnet))
+ if (g_strcmp0(name, channel->name) != 0 ||
+ g_strcmp0(chatnet, channel->chatnet) != 0)
return 1;
return 0;
diff --git a/src/core/servers-setup.c b/src/core/servers-setup.c
index 26632d63..4a048282 100644
--- a/src/core/servers-setup.c
+++ b/src/core/servers-setup.c
@@ -432,11 +432,9 @@ static int compare_server_setup (CONFIG_NODE *node, SERVER_SETUP_REC *server)
chatnet = config_node_get_str(node, "chatnet", NULL);
port = config_node_get_int(node, "port", 0);
- if (address == NULL || chatnet == NULL)
- return 1;
-
- if (strcmp(address, server->address) || strcmp(chatnet, server->chatnet)
- || port != server->port)
+ if (g_strcmp0(address, server->address) != 0 ||
+ g_strcmp0(chatnet, server->chatnet) != 0 ||
+ port != server->port)
return 1;
return 0;