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

Comparing ircd-hybrid/trunk/modules/m_ison.c (file contents):
Revision 4879 by michael, Sun Aug 24 10:27:40 2014 UTC vs.
Revision 4880 by michael, Sun Nov 16 20:56:26 2014 UTC

# Line 54 | Line 54 | m_ison(struct Client *source_p, int parc
54    char *current_insert_point = NULL;
55    char buf[IRCD_BUFSIZE];
56    int len;
57  int done = 0;
57  
58    len = snprintf(buf, sizeof(buf), numeric_form(RPL_ISON), me.name, source_p->name);
59    current_insert_point = buf + len;
60  
61 <  /*
62 <   * rfc1459 is ambigious about how to handle ISON
64 <   * this should handle both interpretations.
65 <   */
66 <  for (int i = 1; i < parc; ++i)
61 >  for (nick = strtoken(&p, parv[1], " "); nick;
62 >       nick = strtoken(&p,    NULL, " "))
63    {
64 <    for (nick = strtoken(&p, parv[i], " "); nick;
69 <         nick = strtoken(&p,    NULL, " "))
64 >    if ((target_p = find_person(source_p, nick)))
65      {
66 <      if ((target_p = find_person(source_p, nick)))
72 <      {
73 <        len = strlen(target_p->name);
66 >      len = strlen(target_p->name);
67  
68 <        if ((current_insert_point + (len + 5)) < (buf + sizeof(buf)))
69 <        {
70 <          strlcpy(current_insert_point, target_p->name, len);
71 <          current_insert_point += len;
72 <          *current_insert_point++ = ' ';
80 <        }
81 <        else
82 <        {
83 <          done = 1;
84 <          break;
85 <        }
68 >      if ((current_insert_point + (len + 5)) < (buf + sizeof(buf)))
69 >      {
70 >        strlcpy(current_insert_point, target_p->name, len + 1);
71 >        current_insert_point += len;
72 >        *current_insert_point++ = ' ';
73        }
74 +      else
75 +        break;
76      }
88
89    if (done)
90      break;
77    }
78  
79 <  /*
94 <   *  current_insert_point--;
95 <   *  Do NOT take out the trailing space, it breaks ircII
96 <   *  --Rodder
97 <   */
98 <  *current_insert_point  = '\0';
79 >  *(current_insert_point - 1)  = '\0';
80  
81    sendto_one(source_p, "%s", buf);
82    return 0;

Diff Legend

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