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

Comparing:
ircd-hybrid-7.2/src/s_misc.c (file contents), Revision 34 by lusky, Sun Oct 2 21:05:51 2005 UTC vs.
ircd-hybrid-8/src/s_misc.c (file contents), Revision 1309 by michael, Sun Mar 25 11:24:18 2012 UTC

# Line 25 | Line 25
25   #include "stdinc.h"
26   #include "s_misc.h"
27   #include "client.h"
28 #include "common.h"
28   #include "irc_string.h"
29   #include "sprintf_irc.h"
30   #include "ircd.h"
# Line 33 | Line 32
32   #include "irc_res.h"
33   #include "fdlist.h"
34   #include "s_bsd.h"
35 < #include "s_conf.h"
35 > #include "conf.h"
36   #include "s_serv.h"
37   #include "send.h"
38   #include "memory.h"
# Line 86 | Line 85 | date(time_t lclock)
85    if (minswest < 0)
86      minswest = -minswest;
87  
88 <  ircsprintf(buf, "%s %s %d %d -- %02u:%02u:%02u %c%02u:%02u",
89 <             weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday,
90 <             lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec,
91 <             plus, minswest/60, minswest%60);
88 >  snprintf(buf, sizeof(buf), "%s %s %d %d -- %02u:%02u:%02u %c%02u:%02u",
89 >           weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday,
90 >           lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec,
91 >           plus, minswest/60, minswest%60);
92    return buf;
93   }
94  
# Line 108 | Line 107 | smalldate(time_t lclock)
107    gm = &gmbuf;
108    lt = localtime(&lclock);
109    
110 <  ircsprintf(buf, "%d/%d/%d %02d.%02d",
111 <             lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday,
112 <             lt->tm_hour, lt->tm_min);
110 >  snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
111 >           lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday,
112 >           lt->tm_hour, lt->tm_min);
113  
114    return buf;
115   }
116  
118 /* small_file_date()
119 * Make a small YYYYMMDD formatted string suitable for a
120 * dated file stamp.
121 */
122 char *
123 small_file_date(time_t lclock)
124 {
125  static char timebuffer[MAX_DATE_STRING];
126  struct tm *tmptr;
127
128  if (!lclock)
129    time(&lclock);
130
131  tmptr = localtime(&lclock);
132  strftime(timebuffer, MAX_DATE_STRING, "%Y%m%d", tmptr);
133
134  return timebuffer;
135 }
136
117   #ifdef HAVE_LIBCRYPTO
118   char *
119 < ssl_get_cipher(SSL *ssl)
119 > ssl_get_cipher(const SSL *ssl)
120   {
121 <  static char buffer[128];
122 <  const char *name = NULL;
143 <  int bits;
144 <
145 <  switch (ssl->session->ssl_version)
146 <  {
147 <    case SSL2_VERSION:
148 <      name = "SSLv2";
149 <      break;
150 <
151 <    case SSL3_VERSION:
152 <      name = "SSLv3";
153 <      break;
154 <
155 <    case TLS1_VERSION:
156 <      name = "TLSv1";
157 <      break;
158 <
159 <    default:
160 <      name = "UNKNOWN";
161 <  }
121 >  static char buffer[IRCD_BUFSIZE / 4];
122 >  int bits = 0;
123  
124    SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), &bits);
125  
126 <  snprintf(buffer, sizeof(buffer), "%s %s-%d",
127 <           name, SSL_get_cipher(ssl), bits);
126 >  snprintf(buffer, sizeof(buffer), "%s %s-%d", SSL_get_version(ssl),
127 >           SSL_get_cipher(ssl), bits);
128    
129    return buffer;
130   }

Diff Legend

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