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

Comparing:
ircd-hybrid-7.3/src/ircd.c (file contents), Revision 1121 by michael, Sun Jan 9 11:03:03 2011 UTC vs.
ircd-hybrid/src/ircd.c (file contents), Revision 1155 by michael, Tue Aug 9 20:27:45 2011 UTC

# Line 34 | Line 34
34   #include "fdlist.h"
35   #include "hash.h"
36   #include "irc_string.h"
37 #include "sprintf_irc.h"
37   #include "ircd_signal.h"
38   #include "s_gline.h"
39   #include "motd.h"
# Line 77 | Line 76 | struct config_file_entry ConfigFileEntry
76   struct server_info ServerInfo;
77   /* admin info set from ircd.conf */
78   struct admin_info AdminInfo = { NULL, NULL, NULL };
79 < struct Counter Count = { 0, 0, 0, 0, 0, 0, 0, 0 };
79 > struct Counter Count = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
80   struct ServerState_t server_state = { 0 };
81   struct logging_entry ConfigLoggingEntry = { 1, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0} };
82   struct ServerStatistics ServerStats;
# Line 195 | Line 194 | set_time(void)
194  
195    if (newtime.tv_sec < CurrentTime)
196    {
197 <    ircsprintf(to_send, "System clock is running backwards - (%lu < %lu)",
198 <               (unsigned long)newtime.tv_sec, (unsigned long)CurrentTime);
197 >    snprintf(to_send, sizeof(to_send),
198 >             "System clock is running backwards - (%lu < %lu)",
199 >             (unsigned long)newtime.tv_sec, (unsigned long)CurrentTime);
200      report_error(L_ALL, to_send, me.name, 0);
201      set_back_events(CurrentTime - newtime.tv_sec);
202    }
# Line 354 | Line 354 | write_pidfile(const char *filename)
354    {
355      char buff[32];
356      unsigned int pid = (unsigned int)getpid();
357 <    size_t nbytes = ircsprintf(buff, "%u\n", pid);
357 >    size_t nbytes = snprintf(buff, sizeof(buff), "%u\n", pid);
358  
359      if ((fbputs(buff, fb, nbytes) == -1))
360        ilog(L_ERROR, "Error writing %u to pid file %s (%s)",
# Line 501 | Line 501 | main(int argc, char *argv[])
501    /* It ain't random, but it ought to be a little harder to guess */
502    init_genrand(SystemTime.tv_sec ^ (SystemTime.tv_usec | (getpid() << 20)));
503  
504  memset(&me, 0, sizeof(me));
505  memset(&meLocalUser, 0, sizeof(meLocalUser));
504    me.localClient = &meLocalUser;
505    dlinkAdd(&me, &me.node, &global_client_list); /* Pointer to beginning
506                                                     of Client list */
509
510  memset(&ServerInfo, 0, sizeof(ServerInfo));
511  memset(&ServerStats, 0, sizeof(ServerStats));
512
507    /* Initialise the channel capability usage counts... */
508    init_chcap_usage_counts();
509  
# Line 610 | Line 604 | main(int argc, char *argv[])
604  
605    strlcpy(me.info, ServerInfo.description, sizeof(me.info));
606  
607 <  me.from    = &me;
608 <  me.servptr = &me;
607 >  me.from     = &me;
608 >  me.servptr  = &me;
609 >  me.lasttime = me.since = me.firsttime = CurrentTime;
610  
611    SetMe(&me);
612    make_server(&me);
613  
619  me.lasttime = me.since = me.firsttime = CurrentTime;
620
614    hash_add_id(&me);
615    hash_add_client(&me);
616    

Diff Legend

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