Changeset a3a3778 for protocols/msn
- Timestamp:
- 2006-12-22T17:17:08Z (18 years ago)
- Branches:
- master
- Children:
- 5c5a586, 9225e08
- Parents:
- 55078f5 (diff), bd28e6a (diff), a51be64 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- protocols/msn
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/Makefile
r55078f5 ra3a3778 17 17 # [SH] Phony targets 18 18 all: msn_mod.o 19 check: all 20 gcov: 21 gcov *.c 19 22 20 23 .PHONY: all clean distclean -
protocols/msn/sb.c
r55078f5 ra3a3778 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.