ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/modules/m_accept.c
(Generate patch)

Comparing:
ircd-hybrid/trunk/modules/m_accept.c (file contents), Revision 3300 by michael, Sat Apr 12 18:26:22 2014 UTC vs.
ircd-hybrid/branches/8.2.x/modules/m_accept.c (file contents), Revision 4042 by michael, Sun Jun 22 16:06:27 2014 UTC

# Line 50 | Line 50 | list_accepts(struct Client *source_p)
50    char *t = nicks;
51    const dlink_node *ptr = NULL;
52  
53 <  len = strlen(me.name) + strlen(source_p->name) + 12;
53 >  /* :me.name 281 source_p->name :n1!u1@h1 n2!u2@h2 ...\r\n */
54 >  /* 1       23456              78                     9 10 */
55 >  len = strlen(me.name) + strlen(source_p->name) + 10;
56  
57    DLINK_FOREACH(ptr, source_p->localClient->acceptlist.head)
58    {
59      const struct split_nuh_item *accept_p = ptr->data;
60      size_t masklen = strlen(accept_p->nickptr) +
61                       strlen(accept_p->userptr) +
62 <                     strlen(accept_p->hostptr) + 2 /* !@ */ ;
62 >                     strlen(accept_p->hostptr) + 3;  /* +3 for ! + @ + space */
63  
64 <    if ((t - nicks) + masklen + len  > IRCD_BUFSIZE)
64 >    if ((t - nicks) + masklen + len > IRCD_BUFSIZE)
65      {
66        *(t - 1) = '\0';
67        sendto_one_numeric(source_p, &me, RPL_ACCEPTLIST, nicks);
# Line 89 | Line 91 | list_accepts(struct Client *source_p)
91   static void
92   add_accept(const struct split_nuh_item *nuh, struct Client *source_p)
93   {
94 <  struct split_nuh_item *accept_p = MyMalloc(sizeof(*accept_p));
94 >  struct split_nuh_item *accept_p = MyCalloc(sizeof(*accept_p));
95  
96    accept_p->nickptr = xstrdup(nuh->nickptr);
97    accept_p->userptr = xstrdup(nuh->userptr);
# Line 122 | Line 124 | m_accept(struct Client *source_p, int pa
124    struct split_nuh_item nuh;
125    struct split_nuh_item *accept_p = NULL;
126  
127 <  if (EmptyString(parv[1]) || !irccmp(parv[1], "*"))
127 >  if (EmptyString(parv[1]) || !strcmp(parv[1], "*"))
128    {
129      list_accepts(source_p);
130      return 0;
# Line 131 | Line 133 | m_accept(struct Client *source_p, int pa
133    for (mask = strtoken(&p, parv[1], ","); mask;
134         mask = strtoken(&p,    NULL, ","))
135    {
136 <    if (*mask == '-' && *++mask != '\0')
136 >    if (*mask == '-' && *++mask)
137      {
138        nuh.nuhmask  = mask;
139        nuh.nickptr  = nick;
# Line 152 | Line 154 | m_accept(struct Client *source_p, int pa
154  
155        del_accept(accept_p, source_p);
156      }
157 <    else if (*mask != '\0')
157 >    else if (*mask)
158      {
159        if (dlink_list_length(&source_p->localClient->acceptlist) >=
160            ConfigFileEntry.max_accept)

Diff Legend

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