libpurple/protocols/myspace/myspace.c

changeset 34304
faf0414a8b51
parent 34297
0f1f0b8c84f8
child 34312
4461d5c1e61c
child 34889
4ea2da14cd0e
--- a/libpurple/protocols/myspace/myspace.c	Tue Aug 20 14:04:56 2013 +0200
+++ b/libpurple/protocols/myspace/myspace.c	Wed Aug 21 14:59:29 2013 +0200
@@ -1035,7 +1035,7 @@
 	/* TODO: use 'Position' in contact_info to take into account where buddy is */
 	purple_blist_add_buddy(buddy, NULL, group, NULL /* insertion point */);
 
-	if (strtol(username, NULL, 10) == uid) {
+	if (strtoul(username, NULL, 10) == uid) {
 		/*
 		 * This user has not set their username!  Set their server
 		 * alias to their display name so that we don't see a bunch
@@ -2979,13 +2979,15 @@
 msim_send_raw(MsimSession *session, const gchar *msg)
 {
 	size_t len;
+	int sent;
 
 	g_return_val_if_fail(msg != NULL, FALSE);
 
 	purple_debug_info("msim", "msim_send_raw: writing <%s>\n", msg);
 	len = strlen(msg);
 
-	return msim_send_really_raw(session->gc, msg, len) == len;
+	sent = msim_send_really_raw(session->gc, msg, len);
+	return sent > 0 && (size_t)sent == len;
 }
 
 static GHashTable *
@@ -3470,7 +3472,7 @@
 	l = purple_accounts_get_all();
 	while (l) {
 		if (purple_account_is_connected(l->data) &&
-			(uid == 0 || purple_account_get_int(l->data, "uid", 0) == uid)) {
+			(uid == 0 || (guint)purple_account_get_int(l->data, "uid", 0) == uid)) {
 			account = l->data;
 			break;
 		}

mercurial