pidgin: bbb4b7cb: The status_text variable is only used in...

markdoliner at pidgin.im markdoliner at pidgin.im
Tue Mar 3 15:30:39 EST 2009


-----------------------------------------------------------------
Revision: bbb4b7cb99a0d6664073546eeabe2264dc9001d1
Ancestor: 510fc7d7a6082b3e125da4da41779d8105945952
Author: markdoliner at pidgin.im
Date: 2009-03-03T20:29:11
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/bbb4b7cb99a0d6664073546eeabe2264dc9001d1

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

ChangeLog: 

The status_text variable is only used inside this block, so move
it all up in there

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	3a2cc7831f7193197a543a713b10d23f3e5744ce
+++ libpurple/protocols/oscar/oscar.c	9f6fac7c7e1256f7f989ff1cb1f9f9b948d7521d
@@ -4812,7 +4812,6 @@ oscar_set_info_and_status(PurpleAccount 
 	}
 	else
 	{
-		char *status_text = NULL;
 
 		htmlaway = purple_status_get_attr_string(status, "message");
 		if ((htmlaway == NULL) || (*htmlaway == '\0'))
@@ -4821,7 +4820,10 @@ oscar_set_info_and_status(PurpleAccount 
 		/* ICQ 6.x seems to use an available message for all statuses so set one */
 		if (od->icq)
 		{
+			char *status_text;
+
 			status_text = purple_markup_strip_html(htmlaway);
+
 			/* If the status_text is longer than 251 characters then truncate it */
 			if (strlen(status_text) > MAXAVAILMSGLEN)
 			{
@@ -4829,8 +4831,8 @@ oscar_set_info_and_status(PurpleAccount 
 				strcpy(tmp, "...");
 			}
 			aim_srv_setextrainfo(od, FALSE, 0, TRUE, status_text, NULL);
+			g_free(status_text);
 		}
-		g_free(status_text);
 
 		/* Set a proper away message for icq too so that they work for old third party clients */
 


More information about the Commits mailing list