Changeset c7eb771
- Timestamp:
- 2010-06-28T00:18:40Z (14 years ago)
- Branches:
- master
- Children:
- ab6006c
- Parents:
- 1c40aa7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r1c40aa7 rc7eb771 323 323 { 324 324 account_t *a; 325 int len; 325 326 326 327 if( global.conf->authmode == AUTHMODE_REGISTERED && !( irc->status & USTATUS_IDENTIFIED ) ) … … 330 331 } 331 332 332 if( g_strcasecmp( cmd[1], "add" ) == 0 ) 333 len = strlen( cmd[1] ); 334 335 if( len >= 1 && g_strncasecmp( cmd[1], "add", len ) == 0 ) 333 336 { 334 337 struct prpl *prpl; … … 356 359 return; 357 360 } 358 else if( g_strcasecmp( cmd[1], "list") == 0 )361 else if( len >= 1 && g_strncasecmp( cmd[1], "list", len ) == 0 ) 359 362 { 360 363 int i = 0; … … 388 391 /* Try the following two only if cmd[2] == NULL */ 389 392 } 390 else if( g_strcasecmp( cmd[1], "on") == 0 )393 else if( len >= 2 && g_strncasecmp( cmd[1], "on", len ) == 0 ) 391 394 { 392 395 if ( irc->b->accounts ) … … 405 408 return; 406 409 } 407 else if( g_strcasecmp( cmd[1], "off") == 0 )410 else if( len >= 2 && g_strncasecmp( cmd[1], "off", len ) == 0 ) 408 411 { 409 412 irc_usermsg( irc, "Deactivating all active (re)connections..." ); … … 421 424 422 425 MIN_ARGS( 2 ); 426 len = strlen( cmd[2] ); 423 427 424 428 /* At least right now, don't accept on/off/set/del as account IDs even … … 437 441 } 438 442 439 if( g_strcasecmp( cmd[2], "del") == 0 )443 if( len >= 1 && g_strncasecmp( cmd[2], "del", len ) == 0 ) 440 444 { 441 445 if( a->ic ) … … 449 453 } 450 454 } 451 else if( g_strcasecmp( cmd[2], "on") == 0 )455 else if( len >= 2 && g_strncasecmp( cmd[2], "on", len ) == 0 ) 452 456 { 453 457 if( a->ic ) … … 456 460 account_on( irc->b, a ); 457 461 } 458 else if( g_strcasecmp( cmd[2], "off") == 0 )462 else if( len >= 2 && g_strncasecmp( cmd[2], "off", len ) == 0 ) 459 463 { 460 464 if( a->ic ) … … 472 476 } 473 477 } 474 else if( g_strcasecmp( cmd[2], "set") == 0 )478 else if( len >= 1 && g_strncasecmp( cmd[2], "set", len ) == 0 ) 475 479 { 476 480 cmd_set_real( irc, cmd + 2, &a->set, cmd_account_set_checkflags ); … … 485 489 { 486 490 irc_channel_t *ic; 487 488 if( g_strcasecmp( cmd[1], "list" ) == 0 ) 491 int len; 492 493 len = strlen( cmd[1] ); 494 495 if( len >= 1 && g_strncasecmp( cmd[1], "list", len ) == 0 ) 489 496 { 490 497 GSList *l; … … 510 517 511 518 MIN_ARGS( 2 ); 519 len = strlen( cmd[2] ); 512 520 513 521 if( ( ic = irc_channel_get( irc, cmd[1] ) ) == NULL ) … … 517 525 } 518 526 519 if( g_strcasecmp( cmd[2], "set") == 0 )527 if( len >= 1 && g_strncasecmp( cmd[2], "set", len ) == 0 ) 520 528 { 521 529 cmd_set_real( irc, cmd + 2, &ic->set, NULL ); 522 530 } 523 else if( g_strcasecmp( cmd[2], "del") == 0 )531 else if( len >= 1 && g_strncasecmp( cmd[2], "del", len ) == 0 ) 524 532 { 525 533 if( !( ic->flags & IRC_CHANNEL_JOINED ) &&
Note: See TracChangeset
for help on using the changeset viewer.