diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-12 23:44:56 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-12 23:44:56 +0100 | 
| commit | b46769d05371e501800a4658a0faf82c4ccdb0dd (patch) | |
| tree | 59958fdff715c3b8b4700e0dc813e6d6dffb8ff8 /protocols/msn/ns.c | |
| parent | be7a180689ba5dc2b1cd1dc14f55c59246e238ed (diff) | |
Some syntax checking fixups; don't make the same mistake of failing just if
the MSN server is sending a little bit *more* info.
And adding xt_insert_node() used in the ADL generation code.
Diffstat (limited to 'protocols/msn/ns.c')
| -rw-r--r-- | protocols/msn/ns.c | 16 | 
1 files changed, 5 insertions, 11 deletions
| diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index 3e02e328..2d40b47b 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -227,13 +227,7 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )  		}  		else if( strcmp( cmd[2], "OK" ) == 0 )  		{ -			if( num_parts == 7 ) -				msn_ns_got_display_name( ic, cmd[4] ); -			else -				imcb_log( ic, "Warning: Friendly name in server response was corrupted" ); -			  			imcb_log( ic, "Authenticated, getting buddy list" ); -			  			msn_soap_memlist_request( ic );  		}  		else @@ -245,7 +239,7 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )  	}  	else if( strcmp( cmd[0], "MSG" ) == 0 )  	{ -		if( num_parts != 4 ) +		if( num_parts < 4 )  		{  			imcb_error( ic, "Syntax error" );  			imc_logout( ic, TRUE ); @@ -347,7 +341,7 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )  	{  		const struct msn_away_state *st; -		if( num_parts != 5 ) +		if( num_parts < 5 )  		{  			imcb_error( ic, "Syntax error" );  			imc_logout( ic, TRUE ); @@ -376,7 +370,7 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )  		char *server;  		int session, port; -		if( num_parts != 7 ) +		if( num_parts < 7 )  		{  			imcb_error( ic, "Syntax error" );  			imc_logout( ic, TRUE ); @@ -420,7 +414,7 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )  	}  	else if( strcmp( cmd[0], "ADD" ) == 0 )  	{ -		if( num_parts == 6 && strcmp( cmd[2], "RL" ) == 0 ) +		if( num_parts >= 6 && strcmp( cmd[2], "RL" ) == 0 )  		{  			GSList *l; @@ -484,7 +478,7 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )  	   and since MSN servers can apparently screw up the formatting. */  	else if( strcmp( cmd[0], "REA" ) == 0 )  	{ -		if( num_parts != 5 ) +		if( num_parts < 5 )  		{  			imcb_error( ic, "Syntax error" );  			imc_logout( ic, TRUE ); | 
