diff src/protocols/oscar/misc.c @ 2931:10a2d4d5bcf2

[gaim-migrate @ 2944] heh. committer: Tailor Script <tailor@pidgin.im>
author Adam Fritzler <mid@auk.cx>
date Tue, 15 Jan 2002 04:07:08 +0000
parents 6d62d4520460
children 07283934dedd
line wrap: on
line diff
--- a/src/protocols/oscar/misc.c	Tue Jan 15 03:50:14 2002 +0000
+++ b/src/protocols/oscar/misc.c	Tue Jan 15 04:07:08 2002 +0000
@@ -30,19 +30,16 @@
 {
 	aim_frame_t *fr;
 	aim_snacid_t snacid;
-	int i, len = 0;
+	int len = 0;
 	char *localcpy = NULL;
 	char *tmpptr = NULL;
 
 	if (!buddy_list || !(localcpy = strdup(buddy_list))) 
 		return -EINVAL;
 
-	i = 0;
-	tmpptr = strtok(localcpy, "&");
-	while ((tmpptr != NULL) && (i < 150)) {
-		faimdprintf(sess, 2, "---adding %d: %s (%d)\n", i, tmpptr, strlen(tmpptr));
-		len += 1+strlen(tmpptr);
-		i++;
+	for (tmpptr = strtok(localcpy, "&"); tmpptr; ) {
+		faimdprintf(sess, 2, "---adding: %s (%d)\n", tmpptr, strlen(tmpptr));
+		len += 1 + strlen(tmpptr);
 		tmpptr = strtok(NULL, "&");
 	}
 
@@ -50,18 +47,16 @@
 		return -ENOMEM;
 
 	snacid = aim_cachesnac(sess, 0x0003, 0x0004, 0x0000, NULL, 0);
-	
 	aim_putsnac(&fr->data, 0x0003, 0x0004, 0x0000, snacid);
 
-	strncpy(localcpy, buddy_list, strlen(buddy_list)+1);
-	i = 0;
-	tmpptr = strtok(localcpy, "&");
-	while ((tmpptr != NULL) & (i < 150)) {
-		faimdprintf(sess, 2, "---adding %d: %s (%d)\n", i, tmpptr, strlen(tmpptr));
-		
+	strncpy(localcpy, buddy_list, strlen(buddy_list) + 1);
+
+	for (tmpptr = strtok(localcpy, "&"); tmpptr; ) {
+
+		faimdprintf(sess, 2, "---adding: %s (%d)\n", tmpptr, strlen(tmpptr));
+
 		aimbs_put8(&fr->data, strlen(tmpptr));
 		aimbs_putraw(&fr->data, tmpptr, strlen(tmpptr));
-		i++;
 		tmpptr = strtok(NULL, "&");
 	}