Fri, 15 Oct 2004 18:44:05 +0000
[gaim-migrate @ 11127]
This fixes a crash trying to send a file on MSN if you can't actually read the
file you're trying to send.
Someone reported this in #gaim, I hope it fixes some bugs in the tracker too.
| src/protocols/msn/msn.c | file | annotate | diff | comparison | revisions |
--- a/src/protocols/msn/msn.c Fri Oct 15 03:34:12 2004 +0000 +++ b/src/protocols/msn/msn.c Fri Oct 15 18:44:05 2004 +0000 @@ -351,9 +351,34 @@ t_msn_xfer_init(GaimXfer *xfer) { MsnSlpLink *slplink; + const char *filename; + FILE *fp; + + filename = gaim_xfer_get_local_filename(xfer); slplink = xfer->data; + if ((fp = fopen(filename, "rb")) == NULL) + { + GaimAccount *account; + GaimConnection *gc; + const char *who; + char *msg; + + account = slplink->session->account; + gc = gaim_account_get_connection(account); + who = slplink->remote_user; + + msg = g_strdup_printf(_("Error reading %s: \n%s.\n"), + filename, strerror(errno)); + gaim_xfer_error(gaim_xfer_get_type(xfer), who, msg); + gaim_xfer_cancel_local(xfer); + g_free(msg); + + return; + } + fclose(fp); + msn_slplink_request_ft(slplink, xfer); }