31 |
|
#include "fdlist.h" |
32 |
|
#include "hash.h" |
33 |
|
#include "irc_string.h" |
34 |
– |
#include "sprintf_irc.h" |
34 |
|
#include "ircd.h" |
35 |
|
#include "s_gline.h" |
36 |
|
#include "numeric.h" |
75 |
|
|
76 |
|
static void check_pings_list(dlink_list *); |
77 |
|
static void check_unknowns_list(void); |
78 |
< |
static void ban_them(struct Client *client_p, struct ConfItem *conf); |
78 |
> |
static void ban_them(struct Client *, struct ConfItem *); |
79 |
|
|
80 |
|
|
81 |
|
/* init_client() |
317 |
|
get_client_name(client_p, HIDE_IP)); |
318 |
|
} |
319 |
|
|
320 |
< |
ircsprintf(scratch, "Ping timeout: %d seconds", |
321 |
< |
(int)(CurrentTime - client_p->lasttime)); |
320 |
> |
snprintf(scratch, sizeof(scratch), "Ping timeout: %d seconds", |
321 |
> |
(int)(CurrentTime - client_p->lasttime)); |
322 |
|
exit_client(client_p, &me, scratch); |
323 |
|
} |
324 |
|
else if (!IsPingWarning(client_p) && pingwarn > 0 && |
653 |
|
* to modify what it points!!! |
654 |
|
*/ |
655 |
|
const char * |
656 |
< |
get_client_name(struct Client *client, int showip) |
656 |
> |
get_client_name(const struct Client *client, int showip) |
657 |
|
{ |
658 |
|
static char nbuf[HOSTLEN * 2 + USERLEN + 5]; |
659 |
|
|
660 |
|
assert(client != NULL); |
661 |
|
|
662 |
|
if (irccmp(client->name, client->host) == 0) |
663 |
< |
return(client->name); |
663 |
> |
return client->name; |
664 |
|
|
665 |
|
if (ConfigServerHide.hide_server_ips) |
666 |
|
if (IsServer(client) || IsConnecting(client) || IsHandshake(client)) |
676 |
|
case SHOW_IP: |
677 |
|
if (MyConnect(client)) |
678 |
|
{ |
679 |
< |
ircsprintf(nbuf, "%s[%s@%s]", client->name, client->username, |
680 |
< |
client->sockhost); |
679 |
> |
snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]", |
680 |
> |
client->name, |
681 |
> |
client->username, client->sockhost); |
682 |
|
break; |
683 |
|
} |
684 |
|
case MASK_IP: |
685 |
< |
ircsprintf(nbuf, "%s[%s@255.255.255.255]", client->name, |
686 |
< |
client->username); |
685 |
> |
snprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]", |
686 |
> |
client->name, client->username); |
687 |
|
break; |
688 |
|
default: |
689 |
< |
ircsprintf(nbuf, "%s[%s@%s]", client->name, client->username, |
690 |
< |
client->host); |
689 |
> |
snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]", |
690 |
> |
client->name, |
691 |
> |
client->username, client->host); |
692 |
|
} |
693 |
|
|
694 |
< |
return(nbuf); |
694 |
> |
return nbuf; |
695 |
|
} |
696 |
|
|
697 |
|
void |
1131 |
|
strlcpy(errmsg, "Remote host closed the connection", |
1132 |
|
sizeof(errmsg)); |
1133 |
|
else |
1134 |
< |
ircsprintf(errmsg, "Read error: %s", |
1135 |
< |
strerror(current_error)); |
1134 |
> |
snprintf(errmsg, sizeof(errmsg), "Read error: %s", |
1135 |
> |
strerror(current_error)); |
1136 |
|
|
1137 |
|
exit_client(client_p, &me, errmsg); |
1138 |
|
} |