diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-02-25 10:55:20 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-02-25 10:55:20 +0000 |
commit | c35075498dfe9605c28fa7ffc0f0ccebee6749f8 (patch) | |
tree | b4ed06063b90bfabb7d4ae2aa6f81b6054582d82 | |
parent | e0b9de7c07a1121d3b45fd17552ce8788cdb2db9 (diff) |
- channel_mode.c: replaced several sprintf() with snprintf()
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@3030 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r-- | src/channel_mode.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/channel_mode.c b/src/channel_mode.c index c4a774d..c50fda8 100644 --- a/src/channel_mode.c +++ b/src/channel_mode.c @@ -1661,11 +1661,11 @@ send_cap_mode_changes(struct Client *client_p, struct Client *source_p, parptr = parabuf; if ((cap & CAP_TS6) && source_p->id[0] != '\0') - mbl = sprintf(modebuf, ":%s TMODE %lu %s ", source_p->id, - (unsigned long)chptr->channelts, chptr->chname); + mbl = snprintf(modebuf, sizeof(modebuf), ":%s TMODE %lu %s ", source_p->id, + (unsigned long)chptr->channelts, chptr->chname); else - mbl = sprintf(modebuf, ":%s MODE %s ", source_p->name, - chptr->chname); + mbl = snprintf(modebuf, sizeof(modebuf), ":%s MODE %s ", source_p->name, + chptr->chname); /* loop the list of - modes we have */ for (i = 0; i < mode_count; i++) @@ -1708,11 +1708,11 @@ send_cap_mode_changes(struct Client *client_p, struct Client *source_p, mc = 0; if ((cap & CAP_TS6) && source_p->id[0] != '\0') - mbl = sprintf(modebuf, ":%s MODE %s ", source_p->id, - chptr->chname); + mbl = snprintf(modebuf, sizeof(modebuf), ":%s MODE %s ", source_p->id, + chptr->chname); else - mbl = sprintf(modebuf, ":%s MODE %s ", source_p->name, - chptr->chname); + mbl = snprintf(modebuf, sizeof(modebuf), ":%s MODE %s ", source_p->name, + chptr->chname); pbl = 0; parabuf[0] = '\0'; @@ -1772,12 +1772,12 @@ send_mode_changes(struct Client *client_p, struct Client *source_p, return; if (IsServer(source_p)) - mbl = sprintf(modebuf, ":%s MODE %s ", (IsHidden(source_p) || - ConfigServerHide.hide_servers) ? - me.name : source_p->name, chptr->chname); + mbl = snprintf(modebuf, sizeof(modebuf), ":%s MODE %s ", (IsHidden(source_p) || + ConfigServerHide.hide_servers) ? + me.name : source_p->name, chptr->chname); else - mbl = sprintf(modebuf, ":%s!%s@%s MODE %s ", source_p->name, - source_p->username, source_p->host, chptr->chname); + mbl = snprintf(modebuf, sizeof(modebuf), ":%s!%s@%s MODE %s ", source_p->name, + source_p->username, source_p->host, chptr->chname); mc = 0; nc = 0; @@ -1813,12 +1813,12 @@ send_mode_changes(struct Client *client_p, struct Client *source_p, mc = 0; if (IsServer(source_p)) - mbl = sprintf(modebuf, ":%s MODE %s ", (IsHidden(source_p) || - ConfigServerHide.hide_servers) ? - me.name : source_p->name, chptr->chname); + mbl = snprintf(modebuf, sizeof(modebuf), ":%s MODE %s ", (IsHidden(source_p) || + ConfigServerHide.hide_servers) ? + me.name : source_p->name, chptr->chname); else - mbl = sprintf(modebuf, ":%s!%s@%s MODE %s ", source_p->name, - source_p->username, source_p->host, chptr->chname); + mbl = snprintf(modebuf, sizeof(modebuf), ":%s!%s@%s MODE %s ", source_p->name, + source_p->username, source_p->host, chptr->chname); pbl = 0; parabuf[0] = '\0'; |