changeset 24623:c52fe0a3b11d

Fixed: purple_circ_buffer not created before append Change QQ number to unsigned long
author Hu Yong <ccpaging@gmail.com>
date Tue, 11 Nov 2008 07:20:48 +0000
parents d8af9602c1b1
children 2457411cc613
files libpurple/protocols/qq/qq_network.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/qq/qq_network.c	Tue Nov 11 07:19:28 2008 +0000
+++ b/libpurple/protocols/qq/qq_network.c	Tue Nov 11 07:20:48 2008 +0000
@@ -324,7 +324,7 @@
 			room_cmd = qq_trans_get_room_cmd(trans);
 			room_id = qq_trans_get_room_id(trans);
 #if 1
-			purple_debug_info("QQ", "%s (0x%02X) for room %d, len %d\n",
+			purple_debug_info("QQ", "%s (0x%02X) for room %u, len %d\n",
 					qq_get_room_cmd_desc(room_cmd), room_cmd, room_id, buf_len);
 #endif
 			qq_proc_room_cmds(gc, seq, room_cmd, room_id, buf + bytes, bytes_not_read, update_class, ship32);
@@ -638,6 +638,9 @@
 		if (conn->can_write_handler == 0) {
 			conn->can_write_handler = purple_input_add(qd->fd, PURPLE_INPUT_WRITE, tcp_can_write, gc);
 		}
+		if (conn->tcp_txbuf == NULL) {
+			conn->tcp_txbuf = purple_circ_buffer_new(4096);
+		}
 		purple_circ_buffer_append(conn->tcp_txbuf, data + ret, data_len - ret);
 	}
 	return ret;
@@ -710,7 +713,7 @@
 	qd->send_seq = rand() & 0xffff;
 
 	qd->is_login = FALSE;
-	qd->uid = strtol(purple_account_get_username(purple_connection_get_account(gc)), NULL, 10);
+	qd->uid = strtoul(purple_account_get_username(purple_connection_get_account(gc)), NULL, 10);
 
 #ifdef DEBUG
 	memset(qd->ld.random_key, 0x01, sizeof(qd->ld.random_key));