fix
This commit is contained in:
parent
dbb24457e3
commit
ba2c8c49ca
5
LICENSE
5
LICENSE
@ -3,9 +3,12 @@ Version 2, December 2004
|
|||||||
|
|
||||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
|
Everyone is permitted to copy and distribute verbatim or modified
|
||||||
|
copies of this license document, and changing it is allowed as long
|
||||||
|
as the name is changed.
|
||||||
|
|
||||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||||
|
|
||||||
|
14
main.c
14
main.c
@ -81,9 +81,6 @@ void recvinfo(int fd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (irc_status == IRCC_CONNECTED)
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,21 +122,12 @@ int main(void) {
|
|||||||
//Register
|
//Register
|
||||||
IRCC_register(&client, NICK);
|
IRCC_register(&client, NICK);
|
||||||
|
|
||||||
//Recv motd and join in channel
|
|
||||||
recvinfo(fd);
|
|
||||||
sleep(5);
|
sleep(5);
|
||||||
for (size_t i = 0; i < sizeof(channels) / sizeof(char *); i++) {
|
for (size_t i = 0; i < sizeof(channels) / sizeof(char *); i++) {
|
||||||
if (channels[i] == NULL)
|
if (channels[i] == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
size_t join_size = strlen("JOIN \r\n") + strlen(channels[i]) + 1;
|
IRCC_join(&client, channels[i], NULL);
|
||||||
char *tmp = malloc(join_size);
|
|
||||||
if (tmp == NULL)
|
|
||||||
die("malloc retured NULL");
|
|
||||||
|
|
||||||
snprintf(tmp, join_size, "JOIN %s\r\n", channels[i]);
|
|
||||||
send(client.socket, tmp, join_size, 0);
|
|
||||||
free(tmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
recvinfo(fd);
|
recvinfo(fd);
|
||||||
|
Loading…
Reference in New Issue
Block a user