/pidgin/main: 2b7c4c034594: Fix file transfer bug.

Mark Doliner mark at kingant.net
Sun Feb 16 13:48:43 EST 2014

Changeset: 2b7c4c034594ca8614b88c5005bb45ae74c4333e
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2014-02-16 10:48 -0800
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/2b7c4c034594


Fix file transfer bug.

I'm not sure exactly what the ramifications were, but I'm pretty sure this
code is wrong. It looks like the 2nd and 3rd params were accidentally swapped
when this code was extracted into its own function in 8df870b218ca.

And it does matter--I tested it with a small test program. As currently
written wc will always be 1, which is != size, which will cause the
file transfer to fail, I think.


 libpurple/xfer.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/libpurple/xfer.c b/libpurple/xfer.c
--- a/libpurple/xfer.c
+++ b/libpurple/xfer.c
@@ -1262,7 +1262,7 @@ purple_xfer_write_file(PurpleXfer *xfer,
 			return FALSE;
-		wc = fwrite(buffer, size, 1, priv->dest_fp);
+		wc = fwrite(buffer, 1, size, priv->dest_fp);
 	if (wc != size) {

More information about the Commits mailing list