# HG changeset patch # User Eric Warmenhoven # Date 998887999 0 # Node ID b7807144bf44db114e24247a41d3b02a48ff9d1a # Parent 74947d32d3c6ebad73d969083307160e899aa3fc [gaim-migrate @ 2179] better reading committer: Tailor Script diff -r 74947d32d3c6 -r b7807144bf44 src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Mon Aug 27 03:47:31 2001 +0000 +++ b/src/protocols/msn/msn.c Mon Aug 27 04:53:19 2001 +0000 @@ -730,7 +730,7 @@ char *user, *tmp = buf; int length; char *msg, *skiphead, *utf, *final; - int len; + int len, r; GET_NEXT(tmp); user = tmp; @@ -742,11 +742,13 @@ msg = g_new0(char, MAX(length + 1, MSN_BUF_LEN)); - if (read(md->fd, msg, length) != length) { - g_free(msg); - hide_login_progress(gc, "Unable to read message"); - signoff(gc); - return; + for (len = 0; len < length; len += r) { + if ((r = read(md->fd, msg+len, length-len)) <= 0) { + g_free(msg); + hide_login_progress(gc, "Unable to read message"); + signoff(gc); + return; + } } if (!g_strcasecmp(user, "hotmail")) {