summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-03-31 14:06:08 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-03-31 14:06:08 +0000
commitd9ffa61844e2e8f8dd1790c2810039f438b8a994 (patch)
tree93327d7c07d0a6303bd6fba48ebcd24f411f4c2f /modules
parent797277f9afab01fa2581f1865bfe7052d9d3e36c (diff)
- Replaced all occurrences of ircsprintf with sprintf/snprintf
and killed sprintf_irc.(c|h) git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1793 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'modules')
-rw-r--r--modules/core/m_join.c7
-rw-r--r--modules/core/m_kill.c1
-rw-r--r--modules/core/m_mode.c7
-rw-r--r--modules/core/m_sjoin.c55
-rw-r--r--modules/m_accept.c7
-rw-r--r--modules/m_dline.c1
-rw-r--r--modules/m_encap.c1
-rw-r--r--modules/m_gline.c1
-rw-r--r--modules/m_ison.c1
-rw-r--r--modules/m_kline.c1
-rw-r--r--modules/m_knock.c1
-rw-r--r--modules/m_map.c5
-rw-r--r--modules/m_names.c1
-rw-r--r--modules/m_topic.c1
-rw-r--r--modules/m_userhost.c29
-rw-r--r--modules/m_watch.c1
-rw-r--r--modules/m_who.c1
-rw-r--r--modules/m_whois.c3
-rw-r--r--modules/m_xline.c1
19 files changed, 53 insertions, 72 deletions
diff --git a/modules/core/m_join.c b/modules/core/m_join.c
index 3eb6908..7937d0c 100644
--- a/modules/core/m_join.c
+++ b/modules/core/m_join.c
@@ -29,7 +29,6 @@
#include "client.h"
#include "hash.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "numeric.h"
#include "send.h"
@@ -541,7 +540,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
what = -1;
}
*mbuf++ = 'k';
- len = ircsprintf(pbuf, "%s ", oldmode->key);
+ len = sprintf(pbuf, "%s ", oldmode->key);
pbuf += len;
}
@@ -553,7 +552,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
what = 1;
}
*mbuf++ = 'l';
- len = ircsprintf(pbuf, "%d ", mode->limit);
+ len = sprintf(pbuf, "%d ", mode->limit);
pbuf += len;
}
@@ -565,7 +564,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
what = 1;
}
*mbuf++ = 'k';
- len = ircsprintf(pbuf, "%s ", mode->key);
+ len = sprintf(pbuf, "%s ", mode->key);
pbuf += len;
}
*mbuf = '\0';
diff --git a/modules/core/m_kill.c b/modules/core/m_kill.c
index 7686b77..c70cbdc 100644
--- a/modules/core/m_kill.c
+++ b/modules/core/m_kill.c
@@ -34,7 +34,6 @@
#include "send.h"
#include "whowas.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "parse.h"
#include "modules.h"
diff --git a/modules/core/m_mode.c b/modules/core/m_mode.c
index fa68b22..897ce59 100644
--- a/modules/core/m_mode.c
+++ b/modules/core/m_mode.c
@@ -29,7 +29,6 @@
#include "client.h"
#include "hash.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "numeric.h"
#include "s_user.h"
@@ -215,8 +214,8 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, char *parv[
strlcpy(s, parv[4], sizeof(banbuf));
/* only need to construct one buffer, for non-ts6 servers */
- mlen = ircsprintf(modebuf, ":%s MODE %s +",
- source_p->name, chptr->chname);
+ mlen = snprintf(modebuf, sizeof(modebuf), ":%s MODE %s +",
+ source_p->name, chptr->chname);
mbuf = modebuf + mlen;
pbuf = parabuf;
@@ -249,7 +248,7 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, char *parv[
}
*mbuf++ = parv[3][0];
- pbuf += ircsprintf(pbuf, "%s ", s);
+ pbuf += sprintf(pbuf, "%s ", s);
modecount++;
}
diff --git a/modules/core/m_sjoin.c b/modules/core/m_sjoin.c
index 53e442f..65a5caa 100644
--- a/modules/core/m_sjoin.c
+++ b/modules/core/m_sjoin.c
@@ -29,7 +29,6 @@
#include "client.h"
#include "hash.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "numeric.h"
#include "send.h"
@@ -270,14 +269,14 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
modebuf[1] = '\0';
}
- buflen = ircsprintf(nick_buf, ":%s SJOIN %lu %s %s %s:",
- source_p->name, (unsigned long)tstosend,
- chptr->chname, modebuf, parabuf);
+ buflen = snprintf(nick_buf, sizeof(nick_buf), ":%s SJOIN %lu %s %s %s:",
+ source_p->name, (unsigned long)tstosend,
+ chptr->chname, modebuf, parabuf);
nick_ptr = nick_buf + buflen;
- buflen = ircsprintf(uid_buf, ":%s SJOIN %lu %s %s %s:",
- ID(source_p), (unsigned long)tstosend,
- chptr->chname, modebuf, parabuf);
+ buflen = snprintf(uid_buf, sizeof(uid_buf), ":%s SJOIN %lu %s %s %s:",
+ ID(source_p), (unsigned long)tstosend,
+ chptr->chname, modebuf, parabuf);
uid_ptr = uid_buf + buflen;
/* check we can fit a nick on the end, as well as \r\n and a prefix "
@@ -397,25 +396,25 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
{
sendto_server(client_p, 0, CAP_TS6, "%s", nick_buf);
- buflen = ircsprintf(nick_buf, ":%s SJOIN %lu %s %s %s:",
- source_p->name, (unsigned long)tstosend,
- chptr->chname, modebuf, parabuf);
+ buflen = snprintf(nick_buf, sizeof(nick_buf), ":%s SJOIN %lu %s %s %s:",
+ source_p->name, (unsigned long)tstosend,
+ chptr->chname, modebuf, parabuf);
nick_ptr = nick_buf + buflen;
}
- nick_ptr += ircsprintf(nick_ptr, "%s%s ", nick_prefix, target_p->name);
+ nick_ptr += sprintf(nick_ptr, "%s%s ", nick_prefix, target_p->name);
if ((uid_ptr - uid_buf + len_uid) > (IRCD_BUFSIZE - 2))
{
sendto_server(client_p, CAP_TS6, 0, "%s", uid_buf);
- buflen = ircsprintf(uid_buf, ":%s SJOIN %lu %s %s %s:",
- ID(source_p), (unsigned long)tstosend,
- chptr->chname, modebuf, parabuf);
+ buflen = snprintf(uid_buf, sizeof(uid_buf), ":%s SJOIN %lu %s %s %s:",
+ ID(source_p), (unsigned long)tstosend,
+ chptr->chname, modebuf, parabuf);
uid_ptr = uid_buf + buflen;
}
- uid_ptr += ircsprintf(uid_ptr, "%s%s ", uid_prefix, ID(target_p));
+ uid_ptr += sprintf(uid_ptr, "%s%s ", uid_prefix, ID(target_p));
if (!IsMember(target_p, chptr))
{
@@ -450,7 +449,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
*mbuf = '\0';
for(lcount = 0; lcount < MAXMODEPARAMS; lcount++)
{
- slen = ircsprintf(sptr, " %s", para[lcount]); /* see? */
+ slen = sprintf(sptr, " %s", para[lcount]); /* see? */
sptr += slen; /* ready for next */
}
sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s %s%s",
@@ -474,7 +473,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
*mbuf = '\0';
for(lcount = 0; lcount < MAXMODEPARAMS; lcount++)
{
- slen = ircsprintf(sptr, " %s", para[lcount]);
+ slen = sprintf(sptr, " %s", para[lcount]);
sptr += slen;
}
sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s %s%s",
@@ -499,7 +498,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
*mbuf = '\0';
for (lcount = 0; lcount < MAXMODEPARAMS; lcount++)
{
- slen = ircsprintf(sptr, " %s", para[lcount]);
+ slen = sprintf(sptr, " %s", para[lcount]);
sptr += slen;
}
sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s %s%s",
@@ -544,7 +543,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
for (lcount = 0; lcount < pargs; lcount++)
{
- slen = ircsprintf(sptr, " %s", para[lcount]);
+ slen = sprintf(sptr, " %s", para[lcount]);
sptr += slen;
}
@@ -631,7 +630,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
if (oldmode->key[0] && !mode->key[0])
{
*mbuf++ = 'k';
- len = ircsprintf(pbuf, "%s ", oldmode->key);
+ len = sprintf(pbuf, "%s ", oldmode->key);
pbuf += len;
pargs++;
}
@@ -651,7 +650,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
if (mode->limit != 0 && oldmode->limit != mode->limit)
{
*mbuf++ = 'l';
- len = ircsprintf(pbuf, "%d ", mode->limit);
+ len = sprintf(pbuf, "%d ", mode->limit);
pbuf += len;
pargs++;
}
@@ -659,7 +658,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
if (mode->key[0] && strcmp(oldmode->key, mode->key))
{
*mbuf++ = 'k';
- len = ircsprintf(pbuf, "%s ", mode->key);
+ len = sprintf(pbuf, "%s ", mode->key);
pbuf += len;
pargs++;
}
@@ -730,7 +729,7 @@ remove_a_mode(struct Channel *chptr, struct Client *source_p,
{
for(i = 0; i < MAXMODEPARAMS; i++)
{
- l = ircsprintf(sp, " %s", lpara[i]);
+ l = sprintf(sp, " %s", lpara[i]);
sp += l;
}
@@ -754,7 +753,7 @@ remove_a_mode(struct Channel *chptr, struct Client *source_p,
*mbuf = '\0';
for(i = 0; i < count; i++)
{
- l = ircsprintf(sp, " %s", lpara[i]);
+ l = sprintf(sp, " %s", lpara[i]);
sp += l;
}
sendto_channel_local(ALL_MEMBERS, 0, chptr,
@@ -787,8 +786,8 @@ remove_ban_list(struct Channel *chptr, struct Client *source_p,
pbuf = lparabuf;
- cur_len = mlen = ircsprintf(lmodebuf, ":%s MODE %s -",
- source_p->name, chptr->chname);
+ cur_len = mlen = sprintf(lmodebuf, ":%s MODE %s -",
+ source_p->name, chptr->chname);
mbuf = lmodebuf + mlen;
DLINK_FOREACH_SAFE(ptr, next_ptr, list->head)
@@ -814,8 +813,8 @@ remove_ban_list(struct Channel *chptr, struct Client *source_p,
*mbuf++ = c;
cur_len += plen;
- pbuf += ircsprintf(pbuf, "%s!%s@%s ", banptr->name, banptr->username,
- banptr->host);
+ pbuf += sprintf(pbuf, "%s!%s@%s ", banptr->name, banptr->username,
+ banptr->host);
++count;
remove_ban(banptr, list);
diff --git a/modules/m_accept.c b/modules/m_accept.c
index 5fd1429..84cec49 100644
--- a/modules/m_accept.c
+++ b/modules/m_accept.c
@@ -27,7 +27,6 @@
#include "stdinc.h"
#include "client.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "list.h"
#include "numeric.h"
@@ -69,9 +68,9 @@ list_accepts(struct Client *source_p)
t = nicks;
}
- t += ircsprintf(t, "%s!%s@%s ",
- accept_p->nickptr,
- accept_p->userptr, accept_p->hostptr);
+ t += sprintf(t, "%s!%s@%s ",
+ accept_p->nickptr,
+ accept_p->userptr, accept_p->hostptr);
}
if (nicks[0] != '\0')
diff --git a/modules/m_dline.c b/modules/m_dline.c
index c2b3177..dd703fd 100644
--- a/modules/m_dline.c
+++ b/modules/m_dline.c
@@ -27,7 +27,6 @@
#include "channel.h"
#include "client.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "conf.h"
#include "ircd.h"
#include "hostmask.h"
diff --git a/modules/m_encap.c b/modules/m_encap.c
index 7d24112..88ca5e8 100644
--- a/modules/m_encap.c
+++ b/modules/m_encap.c
@@ -25,7 +25,6 @@
#include "stdinc.h"
#include "client.h"
#include "parse.h"
-#include "sprintf_irc.h"
#include "s_serv.h"
#include "send.h"
#include "modules.h"
diff --git a/modules/m_gline.c b/modules/m_gline.c
index da0dbd6..2bec753 100644
--- a/modules/m_gline.c
+++ b/modules/m_gline.c
@@ -30,7 +30,6 @@
#include "channel.h"
#include "client.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "conf.h"
#include "hostmask.h"
diff --git a/modules/m_ison.c b/modules/m_ison.c
index 884c1a2..0e67287 100644
--- a/modules/m_ison.c
+++ b/modules/m_ison.c
@@ -25,7 +25,6 @@
#include "stdinc.h"
#include "client.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "numeric.h"
#include "send.h"
diff --git a/modules/m_kline.c b/modules/m_kline.c
index 70c9263..09430ea 100644
--- a/modules/m_kline.c
+++ b/modules/m_kline.c
@@ -27,7 +27,6 @@
#include "channel.h"
#include "client.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "conf.h"
#include "hostmask.h"
diff --git a/modules/m_knock.c b/modules/m_knock.c
index 4ce31d0..51bb53d 100644
--- a/modules/m_knock.c
+++ b/modules/m_knock.c
@@ -29,7 +29,6 @@
#include "client.h"
#include "hash.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "numeric.h"
#include "send.h"
diff --git a/modules/m_map.c b/modules/m_map.c
index c1969c6..4d5c9ab 100644
--- a/modules/m_map.c
+++ b/modules/m_map.c
@@ -30,7 +30,6 @@
#include "conf.h"
#include "ircd.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "parse.h"
@@ -51,13 +50,13 @@ dump_map(struct Client *client_p, const struct Client *root_p,
*pbuf= '\0';
pb = pbuf;
- l = ircsprintf(pb, "%s", root_p->name);
+ l = sprintf(pb, "%s", root_p->name);
pb += l;
len += l;
if (root_p->id[0] != '\0')
{
- l = ircsprintf(pb, "[%s]", root_p->id);
+ l = sprintf(pb, "[%s]", root_p->id);
pb += l;
len += l;
}
diff --git a/modules/m_names.c b/modules/m_names.c
index ce56eb2..f1b9409 100644
--- a/modules/m_names.c
+++ b/modules/m_names.c
@@ -29,7 +29,6 @@
#include "client.h"
#include "hash.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "numeric.h"
#include "send.h"
diff --git a/modules/m_topic.c b/modules/m_topic.c
index d13c3b9..dc7c109 100644
--- a/modules/m_topic.c
+++ b/modules/m_topic.c
@@ -29,7 +29,6 @@
#include "client.h"
#include "hash.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "numeric.h"
#include "send.h"
diff --git a/modules/m_userhost.c b/modules/m_userhost.c
index a27cbfb..1f7c604 100644
--- a/modules/m_userhost.c
+++ b/modules/m_userhost.c
@@ -29,7 +29,6 @@
#include "s_serv.h"
#include "send.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "parse.h"
#include "modules.h"
@@ -67,27 +66,27 @@ m_userhost(struct Client *client_p, struct Client *source_p,
*/
if (MyClient(target_p) && (target_p == source_p))
{
- rl = ircsprintf(response, "%s%s=%c%s@%s ",
- target_p->name,
- HasUMode(target_p, UMODE_OPER) ? "*" : "",
- (target_p->away[0]) ? '-' : '+',
- target_p->username,
- target_p->sockhost);
+ rl = sprintf(response, "%s%s=%c%s@%s ",
+ target_p->name,
+ HasUMode(target_p, UMODE_OPER) ? "*" : "",
+ (target_p->away[0]) ? '-' : '+',
+ target_p->username,
+ target_p->sockhost);
}
else
{
- rl = ircsprintf(response, "%s%s=%c%s@%s ",
- target_p->name, (HasUMode(target_p, UMODE_OPER) &&
- (!HasUMode(target_p, UMODE_HIDDEN) ||
- HasUMode(source_p, UMODE_OPER))) ? "*" : "",
- (target_p->away[0]) ? '-' : '+',
- target_p->username,
- target_p->host);
+ rl = sprintf(response, "%s%s=%c%s@%s ",
+ target_p->name, (HasUMode(target_p, UMODE_OPER) &&
+ (!HasUMode(target_p, UMODE_HIDDEN) ||
+ HasUMode(source_p, UMODE_OPER))) ? "*" : "",
+ (target_p->away[0]) ? '-' : '+',
+ target_p->username,
+ target_p->host);
}
if ((rl + cur_len) < (IRCD_BUFSIZE - 10))
{
- ircsprintf(t, "%s", response);
+ sprintf(t, "%s", response);
t += rl;
cur_len += rl;
}
diff --git a/modules/m_watch.c b/modules/m_watch.c
index 8e952f1..fb75aa4 100644
--- a/modules/m_watch.c
+++ b/modules/m_watch.c
@@ -26,7 +26,6 @@
#include "stdinc.h"
#include "client.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "numeric.h"
#include "conf.h"
diff --git a/modules/m_who.c b/modules/m_who.c
index a030715..09a5495 100644
--- a/modules/m_who.c
+++ b/modules/m_who.c
@@ -33,7 +33,6 @@
#include "s_serv.h"
#include "send.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "conf.h"
#include "parse.h"
#include "modules.h"
diff --git a/modules/m_whois.c b/modules/m_whois.c
index 8b637e8..71e7e50 100644
--- a/modules/m_whois.c
+++ b/modules/m_whois.c
@@ -35,7 +35,6 @@
#include "s_serv.h"
#include "send.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "parse.h"
#include "modules.h"
@@ -317,7 +316,7 @@ whois_person(struct Client *source_p, struct Client *target_p)
t = buf + mlen;
}
- tlen = ircsprintf(t, "%s%s ", get_member_status(ms, 1), chptr->chname);
+ tlen = sprintf(t, "%s%s ", get_member_status(ms, 1), chptr->chname);
t += tlen;
cur_len += tlen;
reply_to_send = 1;
diff --git a/modules/m_xline.c b/modules/m_xline.c
index 0fbea64..9127b08 100644
--- a/modules/m_xline.c
+++ b/modules/m_xline.c
@@ -27,7 +27,6 @@
#include "channel.h"
#include "client.h"
#include "irc_string.h"
-#include "sprintf_irc.h"
#include "ircd.h"
#include "conf.h"
#include "hostmask.h"