diff --git a/src/bip.c b/src/bip.c index 1b3230a..0b4f263 100644 --- a/src/bip.c +++ b/src/bip.c @@ -111,7 +111,7 @@ static int add_server(bip_t *bip, struct server *s, list_t *data) MOVE_STRING(s->host, t->pdata); break; case LEX_PORT: - s->port = t->ndata; + s->port = (unsigned short)t->ndata; break; default: fatal("Config error in server block (%d)", t->type); @@ -317,8 +317,13 @@ static int add_network(bip_t *bip, list_t *data) break; #endif case LEX_SERVER: - n->serverv = bip_realloc(n->serverv, (n->serverc + 1) - * sizeof(struct server)); + if (n->serverc < 0) { + conf_die(bip, "internal error in network statement"); + return 0; + } + + n->serverv = bip_realloc(n->serverv, + (unsigned int)(n->serverc + 1) * sizeof(struct server)); n->serverc++; memset(&n->serverv[n->serverc - 1], 0, sizeof(struct server)); diff --git a/src/connection.c b/src/connection.c index f4cb28e..f7eb0ff 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1496,6 +1496,9 @@ static int SSLize(connection_t *cn, int *nc) return 1; } break; + default: + mylog(LOG_ERROR, "Unknown ssl_check_mode (%d)!", cn->ssl_check_mode); + return 1; } if (err2 == SSL_ERROR_SYSCALL) { @@ -1533,6 +1536,8 @@ static connection_t *_connection_new_SSL(char *dsthostname, char *dstport, switch (conn->ssl_check_mode) { struct stat st_buf; + case SSL_CHECK_NONE: + break; case SSL_CHECK_BASIC: if (!SSL_CTX_load_verify_locations(conn->ssl_ctx_h, check_store, NULL)) { diff --git a/src/irc.c b/src/irc.c index 7caad3b..0ad8d0a 100644 --- a/src/irc.c +++ b/src/irc.c @@ -1360,7 +1360,7 @@ int irc_dispatch(bip_t *bip, struct link_any *l, struct line *line) break; #endif default: - fatal("gnéééééé"); + fatal("irc_dispatch: unknown IRC_TYPE_SERVER"); } return ERR_PROTOCOL; /* never reached */ } diff --git a/src/irc.h b/src/irc.h index e2070bd..1cd6e64 100644 --- a/src/irc.h +++ b/src/irc.h @@ -77,12 +77,12 @@ struct bipuser { char *default_realname; /* backlog options */ - int backlog:1; + char backlog; int backlog_lines; - int always_backlog:1; - int bl_msg_only:1; - int blreset_on_talk:1; - int blreset_connection:1; + char always_backlog; + char bl_msg_only; + char blreset_on_talk; + char blreset_connection; enum BLTimestamp backlog_timestamp; @@ -93,7 +93,7 @@ struct bipuser { #endif hash_t connections; - int in_use:1; /* for mark and sweep on reload */ + char in_use; /* for mark and sweep on reload */ }; struct network @@ -137,10 +137,10 @@ struct link { /** link options */ - int follow_nick:1; - int ignore_first_nick:1; - int autojoin_on_kick:1; - int ignore_server_capab:1; + char follow_nick; + char ignore_first_nick; + char autojoin_on_kick; + char ignore_server_capab; list_t on_connect_send; char *no_client_away_msg; char *away_nick;