aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--protocols/msn/passport.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/protocols/msn/passport.c b/protocols/msn/passport.c
index dd1d9b6f..42b6ea73 100644
--- a/protocols/msn/passport.c
+++ b/protocols/msn/passport.c
@@ -58,6 +58,7 @@ static int passport_get_id_real( gpointer func, gpointer data, char *header )
rep = g_new0( struct passport_reply, 1 );
rep->data = data;
rep->func = func;
+ rep->header = header;
server = g_strdup( prd_cached );
dummy = strchr( server, '/' );
@@ -124,10 +125,14 @@ static void passport_get_id_ready( struct http_request *req )
static char *passport_create_header( char *cookie, char *email, char *pwd )
{
- char *buffer = g_new0( char, 2048 );
+ char *buffer;
char *currenttoken;
char *email_enc, *pwd_enc;
+ currenttoken = strstr( cookie, "lc=" );
+ if( currenttoken == NULL )
+ return NULL;
+
email_enc = g_new0( char, strlen( email ) * 3 + 1 );
strcpy( email_enc, email );
http_encode( email_enc );
@@ -136,20 +141,15 @@ static char *passport_create_header( char *cookie, char *email, char *pwd )
strcpy( pwd_enc, pwd );
http_encode( pwd_enc );
- currenttoken = strstr( cookie, "lc=" );
- if( currenttoken == NULL )
- return( NULL );
-
- g_snprintf( buffer, 2048,
- "Authorization: Passport1.4 OrgVerb=GET,"
- "OrgURL=http%%3A%%2F%%2Fmessenger%%2Emsn%%2Ecom,"
- "sign-in=%s,pwd=%s,%s", email_enc, pwd_enc,
- currenttoken );
+ buffer = g_strdup_printf( "Authorization: Passport1.4 OrgVerb=GET,"
+ "OrgURL=http%%3A%%2F%%2Fmessenger%%2Emsn%%2Ecom,"
+ "sign-in=%s,pwd=%s,%s", email_enc, pwd_enc,
+ currenttoken );
g_free( email_enc );
g_free( pwd_enc );
- return( buffer );
+ return buffer;
}
static int passport_retrieve_dalogin( gpointer func, gpointer data, char *header )