Project

General

Profile

Bug #2493 » 0075-kick_command-Fix-uninitialized-unique_ipaddr-warning.patch

main, S3_3 - Marko Lindqvist, 11/17/2026 08:24 PM

View differences:

server/stdinhand.c
#define MIN_UNIQUE_CONNS 3
const char *unique_ipaddr[MIN_UNIQUE_CONNS];
int i, num_unique_connections = 0;
const char *unique_ipaddr[MIN_UNIQUE_CONNS]
/* BAD_HEURISTIC_INIT() does not work here, but this is equivalent */
#ifndef FREECIV_TESTMATIC
= { nullptr, nullptr, nullptr }
#endif
;
int num_unique_connections = 0;
if (pconn == caller) {
cmd_reply(CMD_KICK, caller, C_FAIL, _("You may not kick yourself."));
......
}
conn_list_iterate(game.est_connections, aconn) {
int i;
for (i = 0; i < num_unique_connections; i++) {
if (0 == strcmp(unique_ipaddr[i], aconn->server.ipaddr)) {
/* Already listed. */
(1-1/2)