From eddbf65b68a6d444a80d290abc8141bf28a739cf Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Tue, 16 Feb 2010 08:55:16 +0200 Subject: [PATCH] filetransfer: strcmp() cleanup Replace with NULL-pointer safe sipe_strequal(). --- src/core/sipe-ft.c | 4 ++-- src/core/sipe.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/sipe-ft.c b/src/core/sipe-ft.c index 0ff87aba..a07c1754 100644 --- a/src/core/sipe-ft.c +++ b/src/core/sipe-ft.c @@ -214,7 +214,7 @@ void sipe_ft_incoming_stop(PurpleXfer *xfer) sipe_file_transfer *ft = xfer->data; gchar* mac1 = sipe_get_mac(filebuf, xfer->size, ft->hash_key); - if (strcmp(mac,mac1)) { + if (!sipe_strequal(mac, mac1)) { purple_xfer_error(purple_xfer_get_type(xfer),xfer->account,xfer->who, "Received file is corrupted"); unlink(xfer->local_filename); @@ -403,7 +403,7 @@ void sipe_ft_outgoing_start(PurpleXfer *xfer) unsigned auth_cookie_received = g_ascii_strtoull(parts[2],NULL,10); // xfer->who has 'sip:' prefix, skip these four characters - gboolean users_match = !strcmp(parts[1], (xfer->who + 4)); + gboolean users_match = sipe_strequal(parts[1], (xfer->who + 4)); if (!users_match || (ft->auth_cookie != auth_cookie_received)) { purple_xfer_error(purple_xfer_get_type(xfer),xfer->account,xfer->who, diff --git a/src/core/sipe.c b/src/core/sipe.c index 1cd7e2e2..9753dee6 100644 --- a/src/core/sipe.c +++ b/src/core/sipe.c @@ -4883,13 +4883,13 @@ static void process_incoming_message(struct sipe_account_data *sip, struct sipms if (result == TRUE) { gchar *invitation_command = sipmsg_find_header(msg, "Invitation-Command"); - if (!strcmp(invitation_command,"INVITE")) { + if (sipe_strequal(invitation_command, "INVITE")) { sipe_ft_incoming_transfer(sip->gc->account,msg); found = TRUE; - } else if (!strcmp(invitation_command,"CANCEL")) { + } else if (sipe_strequal(invitation_command, "CANCEL")) { sipe_ft_incoming_cancel(sip->gc->account, msg); found = TRUE; - } else if (!strcmp(invitation_command,"ACCEPT")) { + } else if (sipe_strequal(invitation_command, "ACCEPT")) { sipe_ft_incoming_accept(sip->gc->account, msg); found = TRUE; } -- 2.11.4.GIT