fixed
This commit is contained in:
parent
6a7a61d6ae
commit
3b8975a21c
16
main.c
16
main.c
@ -2,10 +2,15 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <sys/socket.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sys/socket.h>
|
||||
#include "irc.h"
|
||||
|
||||
#ifdef ENABLE_SSL
|
||||
#include <openssl/err.h>
|
||||
#endif
|
||||
|
||||
IRCC_client client;
|
||||
char *dir = "./";
|
||||
char *ext = ".txt";
|
||||
@ -23,6 +28,7 @@ void die(const char *msg) {
|
||||
|
||||
void sig_handler(int sig) {
|
||||
fprintf(stderr, "history: recived signal: %d\n", sig);
|
||||
|
||||
IRCC_close(&client);
|
||||
exit(0);
|
||||
}
|
||||
@ -110,9 +116,10 @@ int main(int argc, char **argv) {
|
||||
die("connection refused");
|
||||
|
||||
if (usessl) {
|
||||
int irc_errno = 0;
|
||||
if (IRCC_initssl(&client, &irc_errno) == IRCC_ERROR)
|
||||
die(IRCC_errno[irc_errno]);
|
||||
#ifdef ENABLE_SSL
|
||||
if (IRCC_initssl(&client) == IRCC_ERROR)
|
||||
die(ERR_error_string(ERR_get_error(), NULL));
|
||||
#endif
|
||||
}
|
||||
|
||||
//Register and skip motd
|
||||
@ -146,4 +153,3 @@ int main(int argc, char **argv) {
|
||||
WriteToFile();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user