Changeset 42616d1
- Timestamp:
- 2006-05-28T18:24:43Z (18 years ago)
- Branches:
- master
- Children:
- 79b6213
- Parents:
- db28304
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_commands.c
rdb28304 r42616d1 321 321 { 322 322 user_t *u; 323 char buff[IRC_MAX_LINE] ;323 char buff[IRC_MAX_LINE], *s; 324 324 int lenleft, i; 325 325 … … 331 331 for( i = 1; cmd[i]; i ++ ) 332 332 { 333 if( ( u = user_find( irc, cmd[i] ) ) && u->online ) 334 { 335 /* [SH] Make sure we don't use too much buffer space. */ 336 lenleft -= strlen( u->nick ) + 1; 337 338 if( lenleft < 0 ) 333 char *this, *next; 334 335 this = cmd[i]; 336 while( *this ) 337 { 338 if( ( next = strchr( this, ' ' ) ) ) 339 *next = 0; 340 341 if( ( u = user_find( irc, this ) ) && u->online ) 342 { 343 lenleft -= strlen( u->nick ) + 1; 344 345 if( lenleft < 0 ) 346 break; 347 348 strcat( buff, u->nick ); 349 strcat( buff, " " ); 350 } 351 352 if( next ) 353 { 354 *next = ' '; 355 this = next + 1; 356 } 357 else 339 358 { 340 359 break; 341 } 342 343 /* [SH] Add the nick to the buffer. Note 344 * that an extra space is always added. Even 345 * if it's the last nick in the list. Who 346 * cares? 347 */ 348 349 strcat( buff, u->nick ); 350 strcat( buff, " " ); 351 } 352 } 353 354 /* [WvG] Well, maybe someone cares, so why not remove it? */ 360 } 361 } 362 363 /* *sigh* */ 364 if( lenleft < 0 ) 365 break; 366 } 367 355 368 if( strlen( buff ) > 0 ) 356 369 buff[strlen(buff)-1] = '\0';
Note: See TracChangeset
for help on using the changeset viewer.