mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 11:50:10 +02:00
Factor strchr call.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4802 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
b2c8ba134b
commit
0b9a3f4aef
1 changed files with 4 additions and 2 deletions
|
|
@ -343,6 +343,7 @@ static char *expando_cmdchar(SERVER_REC *server, void *item, int *free_ret)
|
|||
static char *expando_chanmode(SERVER_REC *server, void *item, int *free_ret)
|
||||
{
|
||||
char *cmode;
|
||||
char *args;
|
||||
|
||||
*free_ret = FALSE;
|
||||
|
||||
|
|
@ -354,8 +355,9 @@ static char *expando_chanmode(SERVER_REC *server, void *item, int *free_ret)
|
|||
|
||||
*free_ret = TRUE;
|
||||
cmode = g_strdup(CHANNEL(item)->mode);
|
||||
if (strchr(cmode, ' ') != NULL)
|
||||
*(strchr(cmode, ' ')) = 0;
|
||||
args = strchr(cmode, ' ');
|
||||
if (args != NULL)
|
||||
*args = 0;
|
||||
|
||||
return cmode;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue