comparison src/protocols/oscar/ssi.c @ 3239:373346660788

[gaim-migrate @ 3256] Fix for bug i.d. [ 554410 ] Bug in SSI Deleting Last Buddy in Group. (Thanks, KingAnt) committer: Tailor Script <tailor@pidgin.im>
author Jim Seymour <jseymour>
date Fri, 10 May 2002 22:32:41 +0000
parents 5e90ecb578c5
children f56d084d4046
comparison
equal deleted inserted replaced
3238:7f27ede456e1 3239:373346660788
588 588
589 if (!sess || !conn || !gn || !num) 589 if (!sess || !conn || !gn || !num)
590 return -EINVAL; 590 return -EINVAL;
591 591
592 /* Look up the parent group */ 592 /* Look up the parent group */
593 if (!(parentgroup = aim_ssi_itemlist_finditem(sess->ssi.items, NULL, NULL, AIM_SSI_TYPE_GROUP))) { 593 if (!(parentgroup = aim_ssi_itemlist_find(sess->ssi.items, 0, 0))) {
594 aim_ssi_addmastergroup(sess, conn); 594 aim_ssi_addmastergroup(sess, conn);
595 if (!(parentgroup = aim_ssi_itemlist_finditem(sess->ssi.items, NULL, NULL, AIM_SSI_TYPE_GROUP))) 595 if (!(parentgroup = aim_ssi_itemlist_find(sess->ssi.items, 0, 0)))
596 return -ENOMEM; 596 return -ENOMEM;
597 } 597 }
598 598
599 /* Allocate an array of pointers to each of the new items */ 599 /* Allocate an array of pointers to each of the new items */
600 if (!(newitems = (struct aim_ssi_item **)malloc(num*sizeof(struct aim_ssi_item *)))) 600 if (!(newitems = (struct aim_ssi_item **)malloc(num*sizeof(struct aim_ssi_item *))))
838 838
839 if (!sess || !conn) 839 if (!sess || !conn)
840 return -EINVAL; 840 return -EINVAL;
841 841
842 /* Make delitem a pointer to the aim_ssi_item to be deleted */ 842 /* Make delitem a pointer to the aim_ssi_item to be deleted */
843 if (!(delitem = aim_ssi_itemlist_finditem(sess->ssi.items, NULL, NULL, AIM_SSI_TYPE_GROUP))) 843 if (!(delitem = aim_ssi_itemlist_find(sess->ssi.items, 0, 0)))
844 return -EINVAL; 844 return -EINVAL;
845 845
846 /* Remove delitem from the item list */ 846 /* Remove delitem from the item list */
847 if (sess->ssi.items == delitem) { 847 if (sess->ssi.items == delitem) {
848 sess->ssi.items = sess->ssi.items->next; 848 sess->ssi.items = sess->ssi.items->next;
883 883
884 if (!sess || !conn || !gn || !num) 884 if (!sess || !conn || !gn || !num)
885 return -EINVAL; 885 return -EINVAL;
886 886
887 /* Look up the parent group */ 887 /* Look up the parent group */
888 if (!(parentgroup = aim_ssi_itemlist_finditem(sess->ssi.items, NULL, NULL, AIM_SSI_TYPE_GROUP))) 888 if (!(parentgroup = aim_ssi_itemlist_find(sess->ssi.items, 0, 0)))
889 return -EINVAL; 889 return -EINVAL;
890 890
891 /* Allocate an array of pointers to each of the items to be deleted */ 891 /* Allocate an array of pointers to each of the items to be deleted */
892 delitems = (struct aim_ssi_item **)malloc(num*sizeof(struct aim_ssi_item *)); 892 delitems = (struct aim_ssi_item **)malloc(num*sizeof(struct aim_ssi_item *));
893 memset(delitems, 0, num*sizeof(struct aim_ssi_item *)); 893 memset(delitems, 0, num*sizeof(struct aim_ssi_item *));