aboutsummaryrefslogtreecommitdiffstats
path: root/ipc.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2015-01-17 20:13:19 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2015-01-17 20:13:19 +0000
commiteb4ad8d31f7ed4210f24beb8753ecce594b0beef (patch)
treef7f9cf04738522a79f874e0e8ce9b915014861fc /ipc.c
parent1065dd4f38c81c83934ba51526471072837700ae (diff)
parent664bac38fcdf6889d3ceb29b73a0c3a4e27820ce (diff)
Merging random other fixes/cleanups.
Diffstat (limited to 'ipc.c')
-rw-r--r--ipc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ipc.c b/ipc.c
index 65b89498..ef4946ff 100644
--- a/ipc.c
+++ b/ipc.c
@@ -462,7 +462,7 @@ gboolean ipc_child_identify( irc_t *irc )
else if( global.conf->runmode == RUNMODE_DAEMON )
{
GSList *l;
- irc_t *old;
+ irc_t *old = NULL;
char *to_init[] = { "TAKEOVER", "INIT", NULL };
for( l = irc_connection_list; l; l = l->next )
@@ -476,7 +476,7 @@ gboolean ipc_child_identify( irc_t *irc )
strcmp( irc->password, old->password ) == 0 )
break;
}
- if( l == NULL ||
+ if( l == NULL || old == NULL ||
!set_getbool( &irc->b->set, "allow_takeover" ) ||
!set_getbool( &old->b->set, "allow_takeover" ) )
return FALSE;
@@ -523,7 +523,9 @@ static void ipc_command_exec( void *data, char **cmd, const command_t *commands
if( g_strcasecmp( commands[i].command, cmd[0] ) == 0 )
{
/* There is no typo in this line: */
- for( j = 1; cmd[j]; j ++ ); j --;
+ for( j = 1; cmd[j]; j ++ )
+ ;
+ j--;
if( j < commands[i].required_parameters )
break;