mirror of
https://github.com/matrix-construct/construct
synced 2024-11-19 08:21:09 +01:00
Use rb_snprintf() in various places.
This commit is contained in:
parent
847ce0e98d
commit
c2f73e5dbc
10 changed files with 17 additions and 17 deletions
|
@ -121,11 +121,11 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
|
||||||
|
|
||||||
if(ipv6)
|
if(ipv6)
|
||||||
{
|
{
|
||||||
snprintf(outbuf, HOSTLEN, "%s:%x", buf, accum);
|
rb_snprintf(outbuf, HOSTLEN, "%s:%x", buf, accum);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(outbuf, HOSTLEN, "%s.%x", buf, accum);
|
rb_snprintf(outbuf, HOSTLEN, "%s.%x", buf, accum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ is_safe_error(const char *message)
|
||||||
|
|
||||||
if (!strncmp(message, "Closing Link: 127.0.0.1 (", 25))
|
if (!strncmp(message, "Closing Link: 127.0.0.1 (", 25))
|
||||||
return 1;
|
return 1;
|
||||||
snprintf(prefix2, sizeof prefix2,
|
rb_snprintf(prefix2, sizeof prefix2,
|
||||||
"Closing Link: 127.0.0.1 %s (", me.name);
|
"Closing Link: 127.0.0.1 %s (", me.name);
|
||||||
if (!strncmp(message, prefix2, strlen(prefix2)))
|
if (!strncmp(message, prefix2, strlen(prefix2)))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -297,7 +297,7 @@ ms_server(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
ilog(L_SERVER, "Link %s cancelled, server %s already exists",
|
ilog(L_SERVER, "Link %s cancelled, server %s already exists",
|
||||||
client_p->name, name);
|
client_p->name, name);
|
||||||
|
|
||||||
snprintf(squitreason, sizeof squitreason,
|
rb_snprintf(squitreason, sizeof squitreason,
|
||||||
"Server %s already exists",
|
"Server %s already exists",
|
||||||
name);
|
name);
|
||||||
exit_client(client_p, client_p, &me, squitreason);
|
exit_client(client_p, client_p, &me, squitreason);
|
||||||
|
@ -477,7 +477,7 @@ ms_sid(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
ilog(L_SERVER, "Link %s cancelled, server %s already exists",
|
ilog(L_SERVER, "Link %s cancelled, server %s already exists",
|
||||||
client_p->name, parv[1]);
|
client_p->name, parv[1]);
|
||||||
|
|
||||||
snprintf(squitreason, sizeof squitreason,
|
rb_snprintf(squitreason, sizeof squitreason,
|
||||||
"Server %s already exists",
|
"Server %s already exists",
|
||||||
parv[1]);
|
parv[1]);
|
||||||
exit_client(NULL, client_p, &me, squitreason);
|
exit_client(NULL, client_p, &me, squitreason);
|
||||||
|
@ -496,7 +496,7 @@ ms_sid(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
ilog(L_SERVER, "Link %s cancelled, SID %s for server %s already in use by %s",
|
ilog(L_SERVER, "Link %s cancelled, SID %s for server %s already in use by %s",
|
||||||
client_p->name, parv[3], parv[1], target_p->name);
|
client_p->name, parv[3], parv[1], target_p->name);
|
||||||
|
|
||||||
snprintf(squitreason, sizeof squitreason,
|
rb_snprintf(squitreason, sizeof squitreason,
|
||||||
"SID %s for %s already in use by %s",
|
"SID %s for %s already in use by %s",
|
||||||
parv[3], parv[1], target_p->name);
|
parv[3], parv[1], target_p->name);
|
||||||
exit_client(NULL, client_p, &me, squitreason);
|
exit_client(NULL, client_p, &me, squitreason);
|
||||||
|
|
|
@ -89,9 +89,9 @@ add_monitor(struct Client *client_p, const char *nicks)
|
||||||
sendto_one(client_p, "%s", offbuf);
|
sendto_one(client_p, "%s", offbuf);
|
||||||
|
|
||||||
if(p)
|
if(p)
|
||||||
snprintf(buf, sizeof(buf), "%s,%s", name, p);
|
rb_snprintf(buf, sizeof(buf), "%s,%s", name, p);
|
||||||
else
|
else
|
||||||
snprintf(buf, sizeof(buf), "%s", name);
|
rb_snprintf(buf, sizeof(buf), "%s", name);
|
||||||
|
|
||||||
sendto_one(client_p, form_str(ERR_MONLISTFULL),
|
sendto_one(client_p, form_str(ERR_MONLISTFULL),
|
||||||
me.name, client_p->name,
|
me.name, client_p->name,
|
||||||
|
|
|
@ -195,7 +195,7 @@ me_rsfnc(struct Client *client_p, struct Client *source_p,
|
||||||
kill_client_serv_butone(NULL, exist_p, "%s (Nickname regained by services)",
|
kill_client_serv_butone(NULL, exist_p, "%s (Nickname regained by services)",
|
||||||
me.name);
|
me.name);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "Killed (%s (Nickname regained by services))",
|
rb_snprintf(buf, sizeof(buf), "Killed (%s (Nickname regained by services))",
|
||||||
me.name);
|
me.name);
|
||||||
exit_client(NULL, exist_p, &me, buf);
|
exit_client(NULL, exist_p, &me, buf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,7 +214,7 @@ me_svslogin(struct Client *client_p, struct Client *source_p,
|
||||||
kill_client_serv_butone(NULL, exist_p, "%s (Nickname regained by services)",
|
kill_client_serv_butone(NULL, exist_p, "%s (Nickname regained by services)",
|
||||||
me.name);
|
me.name);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "Killed (%s (Nickname regained by services))",
|
rb_snprintf(buf, sizeof(buf), "Killed (%s (Nickname regained by services))",
|
||||||
me.name);
|
me.name);
|
||||||
exit_client(NULL, exist_p, &me, buf);
|
exit_client(NULL, exist_p, &me, buf);
|
||||||
}else if((exist_p = find_client(nick)) && IsUnknown(exist_p) && exist_p != target_p) {
|
}else if((exist_p = find_client(nick)) && IsUnknown(exist_p) && exist_p != target_p) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"Link %s dropped, wrong TS protocol version (%s,%s)",
|
"Link %s dropped, wrong TS protocol version (%s,%s)",
|
||||||
source_p->name, parv[1], parv[2]);
|
source_p->name, parv[1], parv[2]);
|
||||||
snprintf(squitreason, sizeof squitreason, "Incompatible TS version (%s,%s)",
|
rb_snprintf(squitreason, sizeof squitreason, "Incompatible TS version (%s,%s)",
|
||||||
parv[1], parv[2]);
|
parv[1], parv[2]);
|
||||||
exit_client(source_p, source_p, source_p, squitreason);
|
exit_client(source_p, source_p, source_p, squitreason);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -95,7 +95,7 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
"Link %s dropped, excessive TS delta"
|
"Link %s dropped, excessive TS delta"
|
||||||
" (my TS=%ld, their TS=%ld, delta=%d)",
|
" (my TS=%ld, their TS=%ld, delta=%d)",
|
||||||
log_client_name(source_p, SHOW_IP), (long) rb_current_time(), (long) theirtime, deltat);
|
log_client_name(source_p, SHOW_IP), (long) rb_current_time(), (long) theirtime, deltat);
|
||||||
snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%d)",
|
rb_snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%d)",
|
||||||
(long) rb_current_time(), (long) theirtime, deltat);
|
(long) rb_current_time(), (long) theirtime, deltat);
|
||||||
exit_client(source_p, source_p, source_p, squitreason);
|
exit_client(source_p, source_p, source_p, squitreason);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -200,7 +200,7 @@ do_whois(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
{
|
{
|
||||||
char buffer[BUFSIZE];
|
char buffer[BUFSIZE];
|
||||||
|
|
||||||
snprintf(buffer, sizeof(buffer), "%s!%s@%s %s",
|
rb_snprintf(buffer, sizeof(buffer), "%s!%s@%s %s",
|
||||||
target_p->name, target_p->username,
|
target_p->name, target_p->username,
|
||||||
target_p->host, target_p->servptr->name);
|
target_p->host, target_p->servptr->name);
|
||||||
report_operspy(source_p, "WHOIS", buffer);
|
report_operspy(source_p, "WHOIS", buffer);
|
||||||
|
|
|
@ -850,15 +850,15 @@ void irc_dictionary_stats(struct Dictionary *dict, void (*cb)(const char *line,
|
||||||
s_assert(dict != NULL);
|
s_assert(dict != NULL);
|
||||||
|
|
||||||
if (dict->id != NULL)
|
if (dict->id != NULL)
|
||||||
snprintf(str, sizeof str, "Dictionary stats for %s (%d)",
|
rb_snprintf(str, sizeof str, "Dictionary stats for %s (%d)",
|
||||||
dict->id, dict->count);
|
dict->id, dict->count);
|
||||||
else
|
else
|
||||||
snprintf(str, sizeof str, "Dictionary stats for <%p> (%d)",
|
rb_snprintf(str, sizeof str, "Dictionary stats for <%p> (%d)",
|
||||||
(void *)dict, dict->count);
|
(void *)dict, dict->count);
|
||||||
cb(str, privdata);
|
cb(str, privdata);
|
||||||
maxdepth = 0;
|
maxdepth = 0;
|
||||||
sum = stats_recurse(dict->root, 0, &maxdepth);
|
sum = stats_recurse(dict->root, 0, &maxdepth);
|
||||||
snprintf(str, sizeof str, "Depth sum %d Avg depth %d Max depth %d", sum, sum / dict->count, maxdepth);
|
rb_snprintf(str, sizeof str, "Depth sum %d Avg depth %d Max depth %d", sum, sum / dict->count, maxdepth);
|
||||||
cb(str, privdata);
|
cb(str, privdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -364,7 +364,7 @@ handle_command(struct Message *mptr, struct Client *client_p,
|
||||||
ilog(L_SERVER,
|
ilog(L_SERVER,
|
||||||
"Insufficient parameters (%d < %d) for command '%s' from %s.",
|
"Insufficient parameters (%d < %d) for command '%s' from %s.",
|
||||||
i, ehandler.min_para, mptr->cmd, client_p->name);
|
i, ehandler.min_para, mptr->cmd, client_p->name);
|
||||||
snprintf(squitreason, sizeof squitreason,
|
rb_snprintf(squitreason, sizeof squitreason,
|
||||||
"Insufficient parameters (%d < %d) for command '%s'",
|
"Insufficient parameters (%d < %d) for command '%s'",
|
||||||
i, ehandler.min_para, mptr->cmd);
|
i, ehandler.min_para, mptr->cmd);
|
||||||
exit_client(client_p, client_p, client_p, squitreason);
|
exit_client(client_p, client_p, client_p, squitreason);
|
||||||
|
|
Loading…
Reference in a new issue