ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/channel.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/channel.c (file contents):
Revision 4340 by michael, Sat Aug 2 16:53:22 2014 UTC vs.
Revision 4388 by michael, Sun Aug 3 17:45:49 2014 UTC

# Line 55 | Line 55 | struct event splitmode_event =
55   };
56  
57   static mp_pool_t *member_pool, *channel_pool;
58 static char buf[IRCD_BUFSIZE];
58  
59  
60   /*! \brief Initializes the channel blockheap, adds known channel CAPAB
# Line 161 | Line 160 | static void
160   send_members(struct Client *client_p, struct Channel *chptr,
161               char *modebuf, char *parabuf)
162   {
163 +  char buf[IRCD_BUFSIZE] = "";
164    const dlink_node *ptr = NULL;
165    int tlen;              /* length of text to append */
166    char *t, *start;       /* temp char pointer */
# Line 224 | Line 224 | send_mode_list(struct Client *client_p,
224                 const dlink_list *list, char flag)
225   {
226    const dlink_node *ptr = NULL;
227 +  char mbuf[IRCD_BUFSIZE] = "";
228    char pbuf[IRCD_BUFSIZE] = "";
229    int tlen, mlen, cur_len;
230    char *pp = pbuf;
# Line 231 | Line 232 | send_mode_list(struct Client *client_p,
232    if (list->length == 0)
233      return;
234  
235 <  mlen = snprintf(buf, sizeof(buf), ":%s BMASK %lu %s %c :", me.id,
235 >  mlen = snprintf(mbuf, sizeof(mbuf), ":%s BMASK %lu %s %c :", me.id,
236                    (unsigned long)chptr->channelts, chptr->chname, flag);
237    cur_len = mlen;
238  
# Line 247 | Line 248 | send_mode_list(struct Client *client_p,
248      if (cur_len + (tlen - 1) > IRCD_BUFSIZE - 2)
249      {
250        *(pp - 1) = '\0';  /* Get rid of trailing space on buffer */
251 <      sendto_one(client_p, "%s%s", buf, pbuf);
251 >      sendto_one(client_p, "%s%s", mbuf, pbuf);
252  
253        cur_len = mlen;
254        pp = pbuf;
# Line 259 | Line 260 | send_mode_list(struct Client *client_p,
260    }
261  
262    *(pp - 1) = '\0';  /* Get rid of trailing space on buffer */
263 <  sendto_one(client_p, "%s%s", buf, pbuf);
263 >  sendto_one(client_p, "%s%s", mbuf, pbuf);
264   }
265  
266   /*! \brief Send "client_p" a full list of the modes for channel chptr
# Line 414 | Line 415 | channel_member_names(struct Client *sour
415                       int show_eon)
416   {
417    const dlink_node *ptr = NULL;
418 <  char lbuf[IRCD_BUFSIZE + 1] = "";
418 >  char buf[IRCD_BUFSIZE + 1] = "";
419    char *t = NULL, *start = NULL;
420    int tlen = 0;
421    int is_member = IsMember(source_p, chptr);
# Line 423 | Line 424 | channel_member_names(struct Client *sour
424  
425    if (PubChannel(chptr) || is_member)
426    {
427 <    t = lbuf + snprintf(lbuf, sizeof(lbuf), numeric_form(RPL_NAMREPLY),
428 <                        me.name, source_p->name,
429 <                        channel_pub_or_secret(chptr), chptr->chname);
427 >    t = buf + snprintf(buf, sizeof(buf), numeric_form(RPL_NAMREPLY),
428 >                       me.name, source_p->name,
429 >                       channel_pub_or_secret(chptr), chptr->chname);
430      start = t;
431  
432      DLINK_FOREACH(ptr, chptr->members.head)
# Line 456 | Line 457 | channel_member_names(struct Client *sour
457            ++tlen;
458        }
459  
460 <      if (t + tlen - lbuf > IRCD_BUFSIZE - 2)
460 >      if (t + tlen - buf > IRCD_BUFSIZE - 2)
461        {
462          *(t - 1) = '\0';
463 <        sendto_one(source_p, "%s", lbuf);
463 >        sendto_one(source_p, "%s", buf);
464          t = start;
465        }
466  
# Line 475 | Line 476 | channel_member_names(struct Client *sour
476      if (tlen)
477      {
478        *(t - 1) = '\0';
479 <      sendto_one(source_p, "%s", lbuf);
479 >      sendto_one(source_p, "%s", buf);
480      }
481    }
482  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)