diff options
author | dequis <dx@dxzone.com.ar> | 2015-04-07 22:39:05 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-04-07 22:41:05 -0300 |
commit | f14199d9c15a8062b5663fa6fcdae00390473b15 (patch) | |
tree | 730f9fdb49b2e1f26dd56422f83e6b6ab9867d8a /src/irc/dcc | |
parent | 9ffe52ec5e3f0643e7ddd12f4d21c0788d2f8cea (diff) | |
download | irssi-f14199d9c15a8062b5663fa6fcdae00390473b15.zip |
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
Diffstat (limited to 'src/irc/dcc')
-rw-r--r-- | src/irc/dcc/dcc-autoget.c | 2 | ||||
-rw-r--r-- | src/irc/dcc/dcc-chat.c | 4 | ||||
-rw-r--r-- | src/irc/dcc/dcc-get.c | 2 | ||||
-rw-r--r-- | src/irc/dcc/dcc.c | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/irc/dcc/dcc-autoget.c b/src/irc/dcc/dcc-autoget.c index 4768641b..38170c56 100644 --- a/src/irc/dcc/dcc-autoget.c +++ b/src/irc/dcc/dcc-autoget.c @@ -57,7 +57,7 @@ static void sig_dcc_request(GET_DCC_REC *dcc, const char *nickaddr) /* don't autoget files beginning with a dot, if download dir is our home dir (stupid kludge for stupid people) */ if (*dcc->arg == '.' && - strcmp(settings_get_str("dcc_download_path"), "~") == 0) + g_strcmp0(settings_get_str("dcc_download_path"), "~") == 0) return; /* check file size limit, NOTE: it's still possible to send a diff --git a/src/irc/dcc/dcc-chat.c b/src/irc/dcc/dcc-chat.c index 8ee4decd..e3dbe72d 100644 --- a/src/irc/dcc/dcc-chat.c +++ b/src/irc/dcc/dcc-chat.c @@ -191,7 +191,7 @@ static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item) return; /* handle only DCC messages */ - if (strcmp(target, "*") == 0) + if (g_strcmp0(target, "*") == 0) dcc = item_get_dcc(item); else if (*target == '=') dcc = dcc_chat_find_id(target+1); @@ -625,7 +625,7 @@ static void ctcp_msg_dcc_chat(IRC_SERVER_REC *server, const char *data, g_strfreev(params); return; } - passive = paramcount == 4 && strcmp(params[2], "0") == 0; + passive = paramcount == 4 && g_strcmp0(params[2], "0") == 0; dcc = DCC_CHAT(dcc_find_request(DCC_CHAT_TYPE, nick, NULL)); if (dcc != NULL) { diff --git a/src/irc/dcc/dcc-get.c b/src/irc/dcc/dcc-get.c index 69fdc746..1208b5c5 100644 --- a/src/irc/dcc/dcc-get.c +++ b/src/irc/dcc/dcc-get.c @@ -554,7 +554,7 @@ void cmd_dcc_receive(const char *data, DCC_GET_FUNC accept_func, next = tmp->next; if (IS_DCC_GET(dcc) && g_ascii_strcasecmp(dcc->nick, nick) == 0 && (dcc_is_waiting_user(dcc) || dcc->from_dccserver) && - (*fname == '\0' || strcmp(dcc->arg, fname) == 0)) { + (*fname == '\0' || g_strcmp0(dcc->arg, fname) == 0)) { found = TRUE; if (!dcc_is_passive(dcc)) accept_func(dcc); diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c index 6f0d5c81..17f6c477 100644 --- a/src/irc/dcc/dcc.c +++ b/src/irc/dcc/dcc.c @@ -149,7 +149,7 @@ DCC_REC *dcc_find_request(int type, const char *nick, const char *arg) if (dcc->type == type && !dcc_is_connected(dcc) && g_ascii_strcasecmp(dcc->nick, nick) == 0 && - (arg == NULL || strcmp(dcc->arg, arg) == 0)) + (arg == NULL || g_strcmp0(dcc->arg, arg) == 0)) return dcc; } @@ -516,7 +516,7 @@ static void cmd_dcc_close(char *data, IRC_SERVER_REC *server) next = tmp->next; if (dcc->type == type && g_ascii_strcasecmp(dcc->nick, nick) == 0 && - (*arg == '\0' || strcmp(dcc->arg, arg) == 0)) { + (*arg == '\0' || g_strcmp0(dcc->arg, arg) == 0)) { dcc_reject(dcc, server); found = TRUE; } |