mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
Recognise non-zero as error rather than only -1
The error flag can be something other than -1 in the event of an error. Not checking for this could lead to us to try connecting to an unknown IP.
This commit is contained in:
parent
e793d7af9f
commit
2db359fbb3
@ -197,8 +197,7 @@ static void simple_readpipe(SIMPLE_THREAD_REC *rec, GIOChannel *pipe)
|
||||
g_io_channel_unref(rec->pipes[1]);
|
||||
|
||||
ip = iprec.ip4.family != 0 ? &iprec.ip4 : &iprec.ip6;
|
||||
handle = iprec.error == -1 ? NULL :
|
||||
net_connect_ip(ip, rec->port, rec->my_ip);
|
||||
handle = iprec.error ? NULL : net_connect_ip(ip, rec->port, rec->my_ip);
|
||||
|
||||
g_free_not_null(rec->my_ip);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user