changeset 19393:35ae010cc037

Input handlers are unsigned integers. So set them to 0 instead of -1 after removing it.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 23 Aug 2007 23:20:48 +0000
parents 74f7d5e4a605
children baa10a1f2bd3
files libpurple/protocols/yahoo/yahoo.c libpurple/protocols/yahoo/yahoo_packet.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Thu Aug 23 23:07:20 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Thu Aug 23 23:20:48 2007 +0000
@@ -2920,7 +2920,7 @@
 	purple_connection_set_display_name(gc, purple_account_get_username(account));
 
 	yd->fd = -1;
-	yd->txhandler = -1;
+	yd->txhandler = 0;
 	/* TODO: Is there a good grow size for the buffer? */
 	yd->txbuf = purple_circ_buffer_new(0);
 	yd->friends = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, yahoo_friend_free);
--- a/libpurple/protocols/yahoo/yahoo_packet.c	Thu Aug 23 23:07:20 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_packet.c	Thu Aug 23 23:20:48 2007 +0000
@@ -294,7 +294,7 @@
 
 	if (writelen == 0) {
 		purple_input_remove(yd->txhandler);
-		yd->txhandler = -1;
+		yd->txhandler = 0;
 		return;
 	}
 
@@ -355,7 +355,7 @@
 	len = yahoo_packet_build(pkt, 0, yd->wm, yd->jp, &data);
 
 	yahoo_packet_dump(data, len);
-	if (yd->txhandler == -1)
+	if (yd->txhandler == 0)
 		ret = write(yd->fd, data, len);
 	else {
 		ret = -1;
@@ -371,7 +371,7 @@
 	}
 
 	if (ret < len) {
-		if (yd->txhandler == -1)
+		if (yd->txhandler == 0)
 			yd->txhandler = purple_input_add(yd->fd, PURPLE_INPUT_WRITE,
 				yahoo_packet_send_can_write, yd);
 		purple_circ_buffer_append(yd->txbuf, data + ret, len - ret);