- Timestamp:
- 2006-10-24T10:40:28Z (18 years ago)
- Branches:
- master
- Children:
- a3a3778
- Parents:
- 6237ded
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/sb.c
r6237ded rbd28e6a 122 122 if( sb->ready ) 123 123 { 124 char cmd[1024], *buf;124 char *packet, *buf; 125 125 int i, j; 126 126 127 /* Build the message. Convert LF to CR-LF for normal messages. */ 127 128 if( strcmp( text, TYPING_NOTIFICATION_MESSAGE ) != 0 ) 128 129 { … … 142 143 { 143 144 i = strlen( MSN_TYPING_HEADERS ) + strlen( sb->gc->username ); 144 buf = g_new0( char, strlen( MSN_TYPING_HEADERS ) + strlen( sb->gc->username ));145 buf = g_new0( char, i ); 145 146 i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->gc->username ); 146 147 } 147 148 148 g_snprintf( cmd, sizeof( cmd ), "MSG %d N %d\r\n", ++sb->trId, i ); 149 if( msn_sb_write( sb, cmd, strlen( cmd ) ) && msn_sb_write( sb, buf, i ) ) 150 { 151 g_free( buf ); 149 /* Build the final packet (MSG command + the message). */ 150 packet = g_strdup_printf( "MSG %d N %d\r\n%s", ++sb->trId, i, buf ); 151 g_free( buf ); 152 if( msn_sb_write( sb, packet, strlen( packet ) ) ) 153 { 154 g_free( packet ); 152 155 return( 1 ); 153 156 } 154 157 else 155 158 { 156 g_free( buf);159 g_free( packet ); 157 160 return( 0 ); 158 161 }
Note: See TracChangeset
for help on using the changeset viewer.