changeset 1982:03bebfa8247f

[gaim-migrate @ 1992] read can return < 0 so you have to check for that case too committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 10 Jun 2001 02:18:39 +0000
parents 7739e648a28a
children 26ff22691f5e
files plugins/msn/msn.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/msn/msn.c	Sun Jun 10 00:45:43 2001 +0000
+++ b/plugins/msn/msn.c	Sun Jun 10 02:18:39 2001 +0000
@@ -146,9 +146,7 @@
 static char *url_encode(unsigned char *text, int dospace)
 {
 	static char newtext[MSN_BUF_LEN*2];
-	char *buf;
 	char *temp = (char *)malloc(4);
-	int c = 0;
 	int i = 0;
 	int j = 0;
 
@@ -382,7 +380,7 @@
 	
 	bzero(buf, MSN_BUF_LEN);
 	do {
-		if (!read(source, buf + i, 1)) {
+		if (read(source, buf + i, 1) != 1) {
 			free_msn_conn(mc);
 			return;
 		}
@@ -450,7 +448,7 @@
 	bzero(buf, MSN_BUF_LEN);
 		
 	do {
-		if (!read(source, buf + i, 1)) {
+		if (read(source, buf + i, 1) != 1) {
 			if (md->fd == source) {
 				hide_login_progress(gc, "Read error");
 				signoff(gc);
@@ -768,7 +766,7 @@
 	bzero(buf, MSN_BUF_LEN);
 		
 	do {
-		if (!read(source, buf + i, 1)) {
+		if (read(source, buf + i, 1) != 1) {
 			hide_login_progress(gc, "Read error");
 			signoff(gc);
 			return;