172 |
|
AddFlag(to, FLAGS_KILLED); |
173 |
|
|
174 |
|
if (IsClient(from)) |
175 |
< |
sendto_one(from, ERR_GHOSTEDCLIENT, |
175 |
> |
sendto_one(from, form_str(ERR_GHOSTEDCLIENT), |
176 |
|
me.name, from->name, to->name, to->username, |
177 |
|
to->host, to->from); |
178 |
|
|
362 |
|
dlink_node *ptr = NULL, *ptr_next = NULL; |
363 |
|
|
364 |
|
if (IsServer(from)) |
365 |
< |
local_len = sprintf(local_buf, ":%s ", |
365 |
> |
local_len = snprintf(local_buf, sizeof(local_buf), ":%s ", |
366 |
|
from->name); |
367 |
|
else |
368 |
< |
local_len = sprintf(local_buf, ":%s!%s@%s ", |
369 |
< |
from->name, from->username, from->host); |
370 |
< |
remote_len = sprintf(remote_buf, ":%s ", |
371 |
< |
from->name); |
372 |
< |
uid_len = sprintf(uid_buf, ":%s ", |
373 |
< |
ID(from)); |
368 |
> |
local_len = snprintf(local_buf, sizeof(local_buf), ":%s!%s@%s ", |
369 |
> |
from->name, from->username, from->host); |
370 |
> |
remote_len = snprintf(remote_buf, sizeof(remote_buf), ":%s ", |
371 |
> |
from->name); |
372 |
> |
uid_len = snprintf(uid_buf, sizeof(uid_buf), ":%s ", ID(from)); |
373 |
|
|
374 |
|
va_start(alocal, pattern); |
375 |
|
va_start(aremote, pattern); |
531 |
|
|
532 |
|
if (touser && MyConnect(user) && !IsDead(user) && |
533 |
|
user->localClient->serial != current_serial) |
534 |
< |
if (HasCap(target_p, cap) == cap) |
534 |
> |
if (HasCap(user, cap) == cap) |
535 |
|
send_message(user, buffer, len); |
536 |
|
} |
537 |
|
|
546 |
|
* locally connected to this server. |
547 |
|
*/ |
548 |
|
void |
549 |
< |
sendto_channel_local(int type, int nodeaf, struct Channel *chptr, |
549 |
> |
sendto_channel_local(unsigned int type, int nodeaf, struct Channel *chptr, |
550 |
|
const char *pattern, ...) |
551 |
|
{ |
552 |
|
va_list args; |
589 |
|
* WARNING - +D clients are omitted |
590 |
|
*/ |
591 |
|
void |
592 |
< |
sendto_channel_local_butone(struct Client *one, int type, unsigned int cap, |
592 |
> |
sendto_channel_local_butone(struct Client *one, unsigned int type, unsigned int cap, |
593 |
|
struct Channel *chptr, const char *pattern, ...) |
594 |
|
{ |
595 |
|
va_list args; |
634 |
|
* remote to this server. |
635 |
|
*/ |
636 |
|
void |
637 |
< |
sendto_channel_remote(struct Client *one, struct Client *from, int type, |
637 |
> |
sendto_channel_remote(struct Client *one, struct Client *from, unsigned int type, |
638 |
|
const unsigned int caps, const unsigned int nocaps, |
639 |
|
struct Channel *chptr, const char *pattern, ...) |
640 |
|
{ |
716 |
|
struct Client *client_p; |
717 |
|
dlink_node *ptr, *ptr_next; |
718 |
|
char local_buf[IRCD_BUFSIZE], remote_buf[IRCD_BUFSIZE]; |
719 |
< |
int local_len = sprintf(local_buf, ":%s!%s@%s ", from->name, |
720 |
< |
from->username, from->host); |
721 |
< |
int remote_len = sprintf(remote_buf, ":%s ", from->name); |
719 |
> |
int local_len = snprintf(local_buf, sizeof(local_buf), ":%s!%s@%s ", |
720 |
> |
from->name, from->username, from->host); |
721 |
> |
int remote_len = snprintf(remote_buf, sizeof(remote_buf), ":%s ", |
722 |
> |
from->name); |
723 |
|
|
724 |
|
va_start(alocal, pattern); |
725 |
|
va_start(aremote, pattern); |
784 |
|
* side effects - data sent to servers matching with capab |
785 |
|
*/ |
786 |
|
void |
787 |
< |
sendto_match_servs(struct Client *source_p, const char *mask, int cap, |
787 |
> |
sendto_match_servs(struct Client *source_p, const char *mask, unsigned int cap, |
788 |
|
const char *pattern, ...) |
789 |
|
{ |
790 |
|
va_list args; |
853 |
|
if (IsServer(from)) |
854 |
|
{ |
855 |
|
if (IsCapable(to, CAP_TS6) && HasID(from)) |
856 |
< |
len = sprintf(buffer, ":%s ", from->id); |
856 |
> |
len = snprintf(buffer, sizeof(buffer), ":%s ", from->id); |
857 |
|
else |
858 |
< |
len = sprintf(buffer, ":%s ", from->name); |
858 |
> |
len = snprintf(buffer, sizeof(buffer), ":%s ", from->name); |
859 |
|
} |
860 |
|
else |
861 |
< |
len = sprintf(buffer, ":%s!%s@%s ", |
862 |
< |
from->name, from->username, from->host); |
861 |
> |
len = snprintf(buffer, sizeof(buffer), ":%s!%s@%s ", |
862 |
> |
from->name, from->username, from->host); |
863 |
|
} |
864 |
< |
else len = sprintf(buffer, ":%s ", ID_or_name(from, send_to)); |
864 |
> |
else len = snprintf(buffer, sizeof(buffer), ":%s ", ID_or_name(from, send_to)); |
865 |
|
|
866 |
|
va_start(args, pattern); |
867 |
|
len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args); |
868 |
|
va_end(args); |
869 |
|
|
870 |
< |
if(MyClient(to)) |
870 |
> |
if (MyClient(to)) |
871 |
|
send_message(send_to, buffer, len); |
872 |
|
else |
873 |
|
send_message_remote(send_to, from, buffer, len); |
945 |
|
int len; |
946 |
|
|
947 |
|
if (IsClient(source_p)) |
948 |
< |
len = sprintf(buffer, ":%s!%s@%s WALLOPS :", |
949 |
< |
source_p->name, source_p->username, source_p->host); |
948 |
> |
len = snprintf(buffer, sizeof(buffer), ":%s!%s@%s WALLOPS :", |
949 |
> |
source_p->name, source_p->username, |
950 |
> |
source_p->host); |
951 |
|
else |
952 |
< |
len = sprintf(buffer, ":%s WALLOPS :", source_p->name); |
952 |
> |
len = snprintf(buffer, sizeof(buffer), ":%s WALLOPS :", |
953 |
> |
source_p->name); |
954 |
|
|
955 |
|
va_start(args, pattern); |
956 |
|
len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args); |
1028 |
|
if (IsDead(client_p)) |
1029 |
|
return; |
1030 |
|
|
1031 |
< |
len = sprintf(buffer, ":%s KILL %s :", ID_or_name(&me, client_p->from), |
1032 |
< |
ID_or_name(diedie, client_p)); |
1031 |
> |
len = snprintf(buffer, sizeof(buffer), ":%s KILL %s :", |
1032 |
> |
ID_or_name(&me, client_p->from), |
1033 |
> |
ID_or_name(diedie, client_p)); |
1034 |
|
|
1035 |
|
va_start(args, pattern); |
1036 |
|
len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args); |
1050 |
|
* client being unknown to leaf, as in lazylink... |
1051 |
|
*/ |
1052 |
|
void |
1053 |
< |
kill_client_ll_serv_butone(struct Client *one, struct Client *source_p, |
1054 |
< |
const char *pattern, ...) |
1053 |
> |
kill_client_serv_butone(struct Client *one, struct Client *source_p, |
1054 |
> |
const char *pattern, ...) |
1055 |
|
{ |
1056 |
|
va_list args; |
1057 |
|
int have_uid = 0; |
1063 |
|
{ |
1064 |
|
have_uid = 1; |
1065 |
|
va_start(args, pattern); |
1066 |
< |
len_uid = sprintf(buf_uid, ":%s KILL %s :", me.id, ID(source_p)); |
1066 |
> |
len_uid = snprintf(buf_uid, sizeof(buf_uid), ":%s KILL %s :", |
1067 |
> |
me.id, ID(source_p)); |
1068 |
|
len_uid += send_format(&buf_uid[len_uid], IRCD_BUFSIZE - len_uid, pattern, |
1069 |
|
args); |
1070 |
|
va_end(args); |
1071 |
|
} |
1072 |
|
|
1073 |
|
va_start(args, pattern); |
1074 |
< |
len_nick = sprintf(buf_nick, ":%s KILL %s :", me.name, source_p->name); |
1074 |
> |
len_nick = snprintf(buf_nick, sizeof(buf_nick), ":%s KILL %s :", |
1075 |
> |
me.name, source_p->name); |
1076 |
|
len_nick += send_format(&buf_nick[len_nick], IRCD_BUFSIZE - len_nick, pattern, |
1077 |
|
args); |
1078 |
|
va_end(args); |