Change all strcmp() to g_strcmp0() to handle nulls gracefully

Just a string replacement (but i did check every one of them)

    sed -i 's/strcmp(/g_strcmp0(/g' **/*.c
This commit is contained in:
dequis 2015-04-07 22:39:05 -03:00
commit f14199d9c1
57 changed files with 170 additions and 170 deletions

View file

@ -287,7 +287,7 @@ static void cmd_channel_add(const char *data)
if (g_hash_table_lookup(optlist, "noauto")) rec->autojoin = FALSE;
if (botarg != NULL && *botarg != '\0') rec->botmasks = g_strdup(botarg);
if (botcmdarg != NULL && *botcmdarg != '\0') rec->autosendcmd = g_strdup(botcmdarg);
if (*password != '\0' && strcmp(password, "-") != 0) rec->password = g_strdup(password);
if (*password != '\0' && g_strcmp0(password, "-") != 0) rec->password = g_strdup(password);
signal_emit("channel add fill", 2, rec, optlist);
@ -523,7 +523,7 @@ static void cmd_names(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
"names", &optlist, &channel))
return;
if (strcmp(channel, "*") == 0 || *channel == '\0') {
if (g_strcmp0(channel, "*") == 0 || *channel == '\0') {
if (!IS_CHANNEL(item))
cmd_param_error(CMDERR_NOT_JOINED);
@ -561,7 +561,7 @@ static void cmd_names(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
if (unknowns->len > 1)
g_string_truncate(unknowns, unknowns->len-1);
if (unknowns->len > 0 && strcmp(channel, unknowns->str) != 0)
if (unknowns->len > 0 && g_strcmp0(channel, unknowns->str) != 0)
signal_emit("command names", 3, unknowns->str, server, item);
g_string_free(unknowns, TRUE);