/[svn]/ircd-hybrid/trunk/src/misc.c
ViewVC logotype

Diff of /ircd-hybrid/trunk/src/misc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6512 by michael, Sat Sep 5 17:55:15 2015 UTC revision 6513 by michael, Sun Sep 6 18:32:38 2015 UTC
# Line 79  date_iso8601(time_t lclock) Line 79  date_iso8601(time_t lclock)
79   * Thu Nov 24 18:22:48 1986   * Thu Nov 24 18:22:48 1986
80   */   */
81  const char *  const char *
82  myctime(time_t lclock)  date_ctime(time_t lclock)
83  {  {
84    static char buf[MAX_DATE_STRING];    static char buf[MAX_DATE_STRING];
85    static time_t lclock_last;    static time_t lclock_last;
   char *p;  
86    
87    if (!lclock)    if (!lclock)
88      lclock = CurrentTime;      lclock = CurrentTime;
89    
90    if (lclock_last == lclock)    if (lclock_last != lclock)
91      return buf;    {
92        lclock_last = lclock;
93        strftime(buf, sizeof(buf), "%a %b %-e %T %Y", localtime(&lclock));
94      }
95    
   lclock_last = lclock;  
   strlcpy(buf, ctime(&lclock), sizeof(buf));  
   
   if ((p = strchr(buf, '\n')))  
     *p = '\0';  
96    return buf;    return buf;
97  }  }
98    

Legend:
Removed from v.6512  
changed lines
  Added in v.6513

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28