# HG changeset patch # User Stu Tomlinson # Date 1097865845 0 # Node ID 0f1c25270121a266e4e841673180c7770899b91a # Parent 6cbeca0e8f580a5480b2274cf12b07de5aec25c8 [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. committer: Tailor Script diff -r 6cbeca0e8f58 -r 0f1c25270121 src/protocols/msn/msn.c --- 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); }