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

Comparing ircd-hybrid/trunk/src/user.c (file contents):
Revision 3347 by michael, Sun Apr 20 14:03:06 2014 UTC vs.
Revision 3504 by michael, Sat May 10 19:51:29 2014 UTC

# Line 167 | Line 167 | show_lusers(struct Client *source_p)
167                         Count.invisi, dlink_list_length(&global_serv_list));
168    else
169      sendto_one_numeric(source_p, &me, RPL_LUSERCLIENT,
170 <                       (Count.total-Count.invisi), Count.invisi, 1);
170 >                       (Count.total - Count.invisi), Count.invisi, 1);
171  
172 <  if (Count.oper > 0)
172 >  if (Count.oper)
173      sendto_one_numeric(source_p, &me, RPL_LUSEROP, Count.oper);
174  
175 <  if (dlink_list_length(&unknown_list) > 0)
175 >  if (dlink_list_length(&unknown_list))
176      sendto_one_numeric(source_p, &me, RPL_LUSERUNKNOWN, dlink_list_length(&unknown_list));
177  
178 <  if (dlink_list_length(&global_channel_list) > 0)
178 >  if (dlink_list_length(&global_channel_list))
179      sendto_one_numeric(source_p, &me, RPL_LUSERCHANNELS, dlink_list_length(&global_channel_list));
180  
181    if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER))
# Line 532 | Line 532 | register_local_user(struct Client *sourc
532  
533    if (!valid_username(source_p->username, 1))
534    {
535 <    char tmpstr2[IRCD_BUFSIZE] = "";
535 >    char buf[IRCD_BUFSIZE] = "";
536  
537      sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE,
538                           "Invalid username: %s (%s@%s)",
539                           source_p->name, source_p->username, source_p->host);
540      ++ServerStats.is_ref;
541 <    snprintf(tmpstr2, sizeof(tmpstr2), "Invalid username [%s]",
542 <             source_p->username);
543 <    exit_client(source_p, tmpstr2);
541 >    snprintf(buf, sizeof(buf), "Invalid username [%s]", source_p->username);
542 >    exit_client(source_p, buf);
543      return;
544    }
545  
# Line 812 | Line 811 | send_umode(struct Client *client_p, stru
811   {
812    char *m = umode_buf;
813    int what = 0;
815  unsigned int i;
816  unsigned int flag;
814  
815    /*
816     * Build a string in umode_buf to represent the change in the user's
817     * mode between the new (source_p->umodes) and 'old'.
818     */
819 <  for (i = 0; i < 128; ++i)
819 >  for (unsigned int i = 0; i < 128; ++i)
820    {
821 <    flag = user_modes[i];
821 >    unsigned int flag = user_modes[i];
822 >
823      if (!flag)
824        continue;
825  
# Line 1009 | Line 1007 | oper_up(struct Client *source_p)
1007    sendto_one_numeric(source_p, &me, RPL_YOUREOPER);
1008   }
1009  
1010 < static char new_uid[TOTALSIDUID + 1];     /* allow for \0 */
1010 > static char new_uid[TOTALSIDUID + 1];  /* Allow for \0 */
1011  
1012   int
1013   valid_sid(const char *sid)
# Line 1058 | Line 1056 | init_uid(void)
1056   static void
1057   add_one_to_uid(int i)
1058   {
1059 <  if (i != IRC_MAXSID)    /* Not reached server SID portion yet? */
1059 >  if (i != IRC_MAXSID)  /* Not reached server SID portion yet? */
1060    {
1061      if (new_uid[i] == 'Z')
1062        new_uid[i] = '0';
# Line 1090 | Line 1088 | add_one_to_uid(int i)
1088   static const char *
1089   uid_get(void)
1090   {
1091 <  add_one_to_uid(TOTALSIDUID - 1);    /* index from 0 */
1091 >  add_one_to_uid(TOTALSIDUID - 1);  /* Index from 0 */
1092    return new_uid;
1093   }
1094  
# Line 1148 | Line 1146 | add_isupport(const char *name, const cha
1146  
1147    if (ptr == NULL)
1148    {
1149 <    support = MyMalloc(sizeof(*support));
1149 >    support = MyCalloc(sizeof(*support));
1150      dlinkAddTail(support, &support->node, &support_list);
1151    }
1152  
1153    support->name = xstrdup(name);
1154 <  if (options != NULL)
1154 >  if (options)
1155      support->options = xstrdup(options);
1156    support->number = n;
1157  
# Line 1221 | Line 1219 | rebuild_isupport_message_line(void)
1219      p += (n = sprintf(p, "%s", support->name));
1220      len += n;
1221  
1222 <    if (support->options != NULL)
1222 >    if (support->options)
1223      {
1224        p += (n = sprintf(p, "=%s", support->options));
1225        len += n;
# Line 1249 | Line 1247 | rebuild_isupport_message_line(void)
1247      }
1248    }
1249  
1250 <  if (len != 0)
1250 >  if (len)
1251    {
1252      if (*--p == ' ')
1253        *p = '\0';

Diff Legend

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