pidgin: 8204e89e: I realized that I don't like initializin...

markdoliner at pidgin.im markdoliner at pidgin.im
Thu Mar 6 02:41:03 EST 2008


-----------------------------------------------------------------
Revision: 8204e89e4a29b403c7f6b7530ccbd168a775938b
Ancestor: eeb7b4bfaeba72bcb6e66651f9cf17f036118a93
Author: markdoliner at pidgin.im
Date: 2008-03-06T07:29:39
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8204e89e4a29b403c7f6b7530ccbd168a775938b

Modified files:
        libpurple/protocols/oscar/oscar.c

ChangeLog: 

I realized that I don't like initializing variables when I declare
them if I can avoid it

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	3df3cf0be599ab579b7f93b2faa814549392a557
+++ libpurple/protocols/oscar/oscar.c	f19337d8b10fdf2ed4fbf530fc46f46faf454f24
@@ -4980,12 +4980,14 @@ static int purple_ssi_parselist(OscarDat
 		switch (curitem->type) {
 			case 0x0000: { /* Buddy */
 				if (curitem->name) {
-					struct aim_ssi_item *groupitem = aim_ssi_itemlist_find(od->ssi.local, curitem->gid, 0x0000);
-					char *gname = groupitem ? groupitem->name : NULL;
-					char *gname_utf8 = gname ? oscar_utf8_try_convert(gc->account, gname) : NULL;
-					char *alias = aim_ssi_getalias(od->ssi.local, gname, curitem->name);
-					char *alias_utf8;
+					struct aim_ssi_item *groupitem;
+					char *gname, *gname_utf8, *alias, *alias_utf8;
 
+					groupitem = aim_ssi_itemlist_find(od->ssi.local, curitem->gid, 0x0000);
+					gname = groupitem ? groupitem->name : NULL;
+					gname_utf8 = gname ? oscar_utf8_try_convert(gc->account, gname) : NULL;
+					alias = aim_ssi_getalias(od->ssi.local, gname, curitem->name);
+
 					g = purple_find_group(gname_utf8 ? gname_utf8 : _("Orphans"));
 					if (g == NULL) {
 						g = purple_group_new(gname_utf8 ? gname_utf8 : _("Orphans"));
@@ -5039,8 +5041,11 @@ static int purple_ssi_parselist(OscarDat
 			} break;
 
 			case 0x0001: { /* Group */
-				char *gname = curitem->name;
-				char *gname_utf8 = gname ? oscar_utf8_try_convert(gc->account, gname) : NULL;
+				char *gname;
+				char *gname_utf8;
+
+				gname = curitem->name;
+				gname_utf8 = gname ? oscar_utf8_try_convert(gc->account, gname) : NULL;
 				if (gname_utf8 != NULL && purple_find_group(gname_utf8) == NULL) {
 					g = purple_group_new(gname_utf8);
 					purple_blist_add_group(g, NULL);


More information about the Commits mailing list