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

Comparing ircd-hybrid-7.3/src/client.c (file contents):
Revision 1123 by michael, Thu Jan 6 13:39:10 2011 UTC vs.
Revision 1124 by michael, Mon Feb 7 11:45:27 2011 UTC

# Line 31 | Line 31
31   #include "fdlist.h"
32   #include "hash.h"
33   #include "irc_string.h"
34 #include "sprintf_irc.h"
34   #include "ircd.h"
35   #include "s_gline.h"
36   #include "numeric.h"
# Line 76 | Line 75 | static dlink_node *eac_next;  /* next ab
75  
76   static void check_pings_list(dlink_list *);
77   static void check_unknowns_list(void);
78 < static void ban_them(struct Client *client_p, struct ConfItem *conf);
78 > static void ban_them(struct Client *, struct ConfItem *);
79  
80  
81   /* init_client()
# Line 318 | Line 317 | check_pings_list(dlink_list *list)
317                   get_client_name(client_p, HIDE_IP));
318            }
319  
320 <          ircsprintf(scratch, "Ping timeout: %d seconds",
321 <                     (int)(CurrentTime - client_p->lasttime));
320 >          snprintf(scratch, sizeof(scratch), "Ping timeout: %d seconds",
321 >                   (int)(CurrentTime - client_p->lasttime));
322            exit_client(client_p, &me, scratch);
323          }
324          else if (!IsPingWarning(client_p) && pingwarn > 0 &&
# Line 654 | Line 653 | find_chasing(struct Client *client_p, st
653   *        to modify what it points!!!
654   */
655   const char *
656 < get_client_name(struct Client *client, int showip)
656 > get_client_name(const struct Client *client, int showip)
657   {
658    static char nbuf[HOSTLEN * 2 + USERLEN + 5];
659  
660    assert(client != NULL);
661  
662    if (irccmp(client->name, client->host) == 0)
663 <    return(client->name);
663 >    return client->name;
664  
665    if (ConfigServerHide.hide_server_ips)
666      if (IsServer(client) || IsConnecting(client) || IsHandshake(client))
# Line 677 | Line 676 | get_client_name(struct Client *client, i
676      case SHOW_IP:
677        if (MyConnect(client))
678        {
679 <        ircsprintf(nbuf, "%s[%s@%s]", client->name, client->username,
680 <                   client->sockhost);
679 >        snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
680 >                 client->name,
681 >                 client->username, client->sockhost);
682          break;
683        }
684      case MASK_IP:
685 <      ircsprintf(nbuf, "%s[%s@255.255.255.255]", client->name,
686 <                 client->username);
685 >      snprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]",
686 >               client->name, client->username);
687        break;
688      default:
689 <      ircsprintf(nbuf, "%s[%s@%s]", client->name, client->username,
690 <                 client->host);
689 >      snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
690 >               client->name,
691 >               client->username, client->host);
692    }
693  
694 <  return(nbuf);
694 >  return nbuf;
695   }
696  
697   void
# Line 1130 | Line 1131 | dead_link_on_read(struct Client *client_
1131      strlcpy(errmsg, "Remote host closed the connection",
1132              sizeof(errmsg));
1133    else
1134 <    ircsprintf(errmsg, "Read error: %s",
1135 <               strerror(current_error));
1134 >    snprintf(errmsg, sizeof(errmsg), "Read error: %s",
1135 >             strerror(current_error));
1136  
1137    exit_client(client_p, &me, errmsg);
1138   }

Diff Legend

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