# HG changeset patch # User andrew.victor@mxit.com # Date 1314087816 0 # Node ID 9d7c8d6f4a66611808ef45c43df6ec06f0983508 # Parent 5dafa68c8eb02fd206faa0d9f9a95b281a040e04 Rather use the accessor function purple_account_get_username(). diff -r 5dafa68c8eb0 -r 9d7c8d6f4a66 libpurple/protocols/mxit/login.c --- a/libpurple/protocols/mxit/login.c Tue Aug 23 05:43:51 2011 +0000 +++ b/libpurple/protocols/mxit/login.c Tue Aug 23 08:23:36 2011 +0000 @@ -53,13 +53,14 @@ PurpleConnection* con = NULL; /* currently the wapsite does not handle a '+' in front of the username (mxitid) so we just strip it */ - if ( account->username[0] == '+' ) { - char* fixed; + { + const char* username = purple_account_get_username( account ); - /* cut off the '+' */ - fixed = g_strdup( &account->username[1] ); - purple_account_set_username( account, fixed ); - g_free( fixed ); + if ( username[0] == '+' ) { + char* fixed = g_strdup( &account->username[1] ); + purple_account_set_username( account, fixed ); + g_free( fixed ); + } } session = g_new0( struct MXitSession, 1 );