Index: skype/skype.c
===================================================================
--- skype/skype.c	(revision a2ed574e86a997a9e245eb821add1ee786629921)
+++ skype/skype.c	(revision a5f4040ca3d4d70c593875cfedb3c1f6a249ace4)
@@ -147,8 +147,9 @@
  */
 
-int skype_write( struct im_connection *ic, char *buf, int len )
+int skype_write( struct im_connection *ic, char *buf )
 {
 	struct skype_data *sd = ic->proto_data;
 	struct pollfd pfd[1];
+	int len = strlen(buf);
 
 	pfd[0].fd = sd->fd;
@@ -172,5 +173,5 @@
 	struct skype_buddy_ask_data *bla = data;
 	char *buf = g_strdup_printf("SET USER %s ISAUTHORIZED TRUE", bla->handle);
-	skype_write( bla->ic, buf, strlen( buf ) );
+	skype_write( bla->ic, buf );
 	g_free(buf);
 	g_free(bla->handle);
@@ -182,5 +183,5 @@
 	struct skype_buddy_ask_data *bla = data;
 	char *buf = g_strdup_printf("SET USER %s ISAUTHORIZED FALSE", bla->handle);
-	skype_write( bla->ic, buf, strlen( buf ) );
+	skype_write( bla->ic, buf );
 	g_free(buf);
 	g_free(bla->handle);
@@ -205,5 +206,5 @@
 	struct skype_buddy_ask_data *bla = data;
 	char *buf = g_strdup_printf("SET CALL %s STATUS INPROGRESS", bla->handle);
-	skype_write( bla->ic, buf, strlen( buf ) );
+	skype_write( bla->ic, buf );
 	g_free(buf);
 	g_free(bla->handle);
@@ -215,5 +216,5 @@
 	struct skype_buddy_ask_data *bla = data;
 	char *buf = g_strdup_printf("SET CALL %s STATUS FINISHED", bla->handle);
-	skype_write( bla->ic, buf, strlen( buf ) );
+	skype_write( bla->ic, buf );
 	g_free(buf);
 	g_free(bla->handle);
@@ -307,5 +308,5 @@
 				{
 					g_snprintf(buf, 1024, "GET USER %s ONLINESTATUS\n", *i);
-					skype_write( ic, buf, strlen( buf ) );
+					skype_write( ic, buf );
 					i++;
 				}
@@ -540,11 +541,11 @@
 						 */
 						g_snprintf(buf, 1024, "GET CHATMESSAGE %s FROM_HANDLE\n", id);
-						skype_write( ic, buf, strlen( buf ) );
+						skype_write( ic, buf );
 						g_snprintf(buf, 1024, "GET CHATMESSAGE %s BODY\n", id);
-						skype_write( ic, buf, strlen( buf ) );
+						skype_write( ic, buf );
 						g_snprintf(buf, 1024, "GET CHATMESSAGE %s TYPE\n", id);
-						skype_write( ic, buf, strlen( buf ) );
+						skype_write( ic, buf );
 						g_snprintf(buf, 1024, "GET CHATMESSAGE %s CHATNAME\n", id);
-						skype_write( ic, buf, strlen( buf ) );
+						skype_write( ic, buf );
 					}
 					else if(!strncmp(info, "FROM_HANDLE ", 12))
@@ -640,5 +641,5 @@
 						sd->call_id = g_strdup(id);
 						g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
-						skype_write( ic, buf, strlen( buf ) );
+						skype_write( ic, buf );
 						sd->call_status = SKYPE_CALL_RINGING;
 					}
@@ -646,5 +647,5 @@
 					{
 						g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
-						skype_write( ic, buf, strlen( buf ) );
+						skype_write( ic, buf );
 						sd->call_status = SKYPE_CALL_MISSED;
 					}
@@ -652,5 +653,5 @@
 					{
 							g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
-							skype_write( ic, buf, strlen( buf ) );
+							skype_write( ic, buf );
 							sd->call_status = SKYPE_CALL_CANCELLED;
 					}
@@ -658,5 +659,5 @@
 					{
 						g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
-						skype_write( ic, buf, strlen( buf ) );
+						skype_write( ic, buf );
 						sd->call_status = SKYPE_CALL_FINISHED;
 					}
@@ -664,5 +665,5 @@
 					{
 						g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
-						skype_write( ic, buf, strlen( buf ) );
+						skype_write( ic, buf );
 						sd->call_status = SKYPE_CALL_REFUSED;
 					}
@@ -743,5 +744,5 @@
 					{
 						g_snprintf(buf, 1024, "GET FILETRANSFER %s PARTNER_HANDLE\n", id);
-						skype_write( ic, buf, strlen( buf ) );
+						skype_write( ic, buf );
 						sd->filetransfer_status = SKYPE_FILETRANSFER_NEW;
 					}
@@ -749,5 +750,5 @@
 					{
 						g_snprintf(buf, 1024, "GET FILETRANSFER %s PARTNER_HANDLE\n", id);
-						skype_write( ic, buf, strlen( buf ) );
+						skype_write( ic, buf );
 						sd->filetransfer_status = SKYPE_FILETRANSFER_FAILED;
 					}
@@ -787,7 +788,7 @@
 						imcb_chat_new( ic, id );
 						g_snprintf(buf, 1024, "GET CHAT %s ADDER\n", id);
-						skype_write(ic, buf, strlen(buf));
+						skype_write(ic, buf);
 						g_snprintf(buf, 1024, "GET CHAT %s TOPIC\n", id);
-						skype_write(ic, buf, strlen(buf));
+						skype_write(ic, buf);
 					}
 					else if(!strcmp(info, "STATUS DIALOG") && sd->groupchat_with)
@@ -801,5 +802,5 @@
 						 * just leave it out. */
 						/*g_snprintf(buf, 1024, "OPEN CHAT %s\n", id);
-						skype_write(ic, buf, strlen(buf));*/
+						skype_write(ic, buf);*/
 						g_snprintf(buf, 1024, "%s@skype.com", sd->groupchat_with);
 						imcb_chat_add_buddy(gc, buf);
@@ -808,7 +809,7 @@
 						sd->groupchat_with = NULL;
 						g_snprintf(buf, 1024, "GET CHAT %s ADDER\n", id);
-						skype_write(ic, buf, strlen(buf));
+						skype_write(ic, buf);
 						g_snprintf(buf, 1024, "GET CHAT %s TOPIC\n", id);
-						skype_write(ic, buf, strlen(buf));
+						skype_write(ic, buf);
 					}
 					else if(!strcmp(info, "STATUS UNSUBSCRIBED"))
@@ -883,5 +884,5 @@
 			{
 				g_snprintf(buf, 1024, "PONG\n");
-				skype_write(ic, buf, strlen(buf));
+				skype_write(ic, buf);
 			}
 			else if(!strncmp(line, "CHATS ", 6))
@@ -894,7 +895,7 @@
 				{
 					g_snprintf(buf, 1024, "GET CHAT %s STATUS\n", *i);
-					skype_write( ic, buf, strlen( buf ) );
+					skype_write( ic, buf );
 					g_snprintf(buf, 1024, "GET CHAT %s ACTIVEMEMBERS\n", *i);
-					skype_write( ic, buf, strlen( buf ) );
+					skype_write( ic, buf );
 					i++;
 				}
@@ -931,16 +932,16 @@
 	/* Log in */
 	buf = g_strdup_printf("USERNAME %s\n", ic->acc->user);
-	st = skype_write( ic, buf, strlen( buf ) );
+	st = skype_write( ic, buf );
 	g_free(buf);
 	buf = g_strdup_printf("PASSWORD %s\n", ic->acc->pass);
-	st = skype_write( ic, buf, strlen( buf ) );
+	st = skype_write( ic, buf );
 	g_free(buf);
 
 	/* This will download all buddies. */
 	buf = g_strdup_printf("SEARCH FRIENDS\n");
-	st = skype_write( ic, buf, strlen( buf ) );
+	st = skype_write( ic, buf );
 	g_free(buf);
 	buf = g_strdup_printf("SET USERSTATUS ONLINE\n");
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(buf);
 
@@ -948,5 +949,5 @@
 	if (set_getbool(&ic->acc->set, "auto_join")) {
 		buf = g_strdup_printf("SEARCH BOOKMARKEDCHATS\n");
-		skype_write( ic, buf, strlen( buf ) );
+		skype_write( ic, buf );
 		g_free(buf);
 	}
@@ -993,5 +994,5 @@
 
 	buf = g_strdup_printf("SET USERSTATUS OFFLINE\n");
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(buf);
 
@@ -1017,5 +1018,5 @@
 		buf = g_strdup_printf("MESSAGE %s %s\n", nick, message);
 	g_free(nick);
-	st = skype_write( ic, buf, strlen( buf ) );
+	st = skype_write( ic, buf );
 	g_free(buf);
 
@@ -1044,5 +1045,5 @@
 		state = skype_away_state_by_name( state_txt );
 	buf = g_strdup_printf("SET USERSTATUS %s\n", state->code);
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(buf);
 }
@@ -1067,5 +1068,5 @@
 
 	buf = g_strdup_printf("SET PROFILE FULLNAME %s", value);
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(buf);
 	return(value);
@@ -1079,5 +1080,5 @@
 
 	buf = g_strdup_printf("GET PROFILE PSTN_BALANCE");
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(buf);
 	return(value);
@@ -1104,5 +1105,5 @@
 
 		buf = g_strdup_printf("CALL %s", nick);
-		skype_write( ic, buf, strlen( buf ) );
+		skype_write( ic, buf );
 		g_free(buf);
 		g_free(nick);
@@ -1114,5 +1115,5 @@
 		{
 			buf = g_strdup_printf("SET CALL %s STATUS FINISHED", sd->call_id);
-			skype_write( ic, buf, strlen( buf ) );
+			skype_write( ic, buf );
 			g_free(buf);
 			g_free(sd->call_id);
@@ -1136,5 +1137,5 @@
 		*ptr = '\0';
 	buf = g_strdup_printf("SET USER %s BUDDYSTATUS 2 Please authorize me\n", nick);
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(nick);
 }
@@ -1149,5 +1150,5 @@
 		*ptr = '\0';
 	buf = g_strdup_printf("SET USER %s BUDDYSTATUS 1\n", nick);
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(nick);
 }
@@ -1158,5 +1159,5 @@
 	char *buf;
 	buf = g_strdup_printf("CHATMESSAGE %s %s\n", gc->title, message);
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(buf);
 }
@@ -1167,5 +1168,5 @@
 	char *buf;
 	buf = g_strdup_printf("ALTER CHAT %s LEAVE\n", gc->title);
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(buf);
 	gc->data = (void*)TRUE;
@@ -1181,5 +1182,5 @@
 		*ptr = '\0';
 	buf = g_strdup_printf("ALTER CHAT %s ADDMEMBERS %s\n", gc->title, nick);
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(buf);
 	g_free(nick);
@@ -1192,5 +1193,5 @@
 	char *buf;
 	buf = g_strdup_printf("ALTER CHAT %s SETTOPIC %s\n", gc->title, message);
-	skype_write( ic, buf, strlen( buf ) );
+	skype_write( ic, buf );
 	g_free(buf);
 	sd->topic_wait = 1;
@@ -1206,5 +1207,5 @@
 		*ptr = '\0';
 	buf = g_strdup_printf("CHAT CREATE %s\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	sd->groupchat_with = g_strdup(nick);
@@ -1223,47 +1224,47 @@
 		*ptr = '\0';
 	buf = g_strdup_printf("GET USER %s FULLNAME\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s PHONE_HOME\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s PHONE_OFFICE\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s PHONE_MOBILE\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s NROF_AUTHED_BUDDIES\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s TIMEZONE\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s LASTONLINETIMESTAMP\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s BIRTHDAY\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s SEX\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s LANGUAGE\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s COUNTRY\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s PROVINCE\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s CITY\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s HOMEPAGE\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 	buf = g_strdup_printf("GET USER %s ABOUT\n", nick);
-	skype_write(ic, buf, strlen(buf));
+	skype_write(ic, buf);
 	g_free(buf);
 }
