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/src/s_misc.c (file contents), Revision 32 by knight, Sun Oct 2 20:41:23 2005 UTC vs.
ircd-hybrid/trunk/src/s_misc.c (file contents), Revision 1793 by michael, Sun Mar 31 14:06:08 2013 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"
30 #include "sprintf_irc.h"
29   #include "ircd.h"
30   #include "numeric.h"
31   #include "irc_res.h"
32   #include "fdlist.h"
33   #include "s_bsd.h"
34 < #include "s_conf.h"
34 > #include "conf.h"
35   #include "s_serv.h"
36   #include "send.h"
37   #include "memory.h"
# Line 86 | Line 84 | date(time_t lclock)
84    if (minswest < 0)
85      minswest = -minswest;
86  
87 <  ircsprintf(buf, "%s %s %d %d -- %02u:%02u:%02u %c%02u:%02u",
88 <             weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday,
89 <             lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec,
90 <             plus, minswest/60, minswest%60);
87 >  snprintf(buf, sizeof(buf), "%s %s %d %d -- %02u:%02u:%02u %c%02u:%02u",
88 >           weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday,
89 >           lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec,
90 >           plus, minswest/60, minswest%60);
91    return buf;
92   }
93  
# Line 108 | Line 106 | smalldate(time_t lclock)
106    gm = &gmbuf;
107    lt = localtime(&lclock);
108    
109 <  ircsprintf(buf, "%d/%d/%d %02d.%02d",
110 <             lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday,
111 <             lt->tm_hour, lt->tm_min);
109 >  snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
110 >           lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday,
111 >           lt->tm_hour, lt->tm_min);
112  
113    return buf;
114   }
115  
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
116   #ifdef HAVE_LIBCRYPTO
117   char *
118 < ssl_get_cipher(SSL *ssl)
118 > ssl_get_cipher(const SSL *ssl)
119   {
120 <  static char buffer[128];
121 <  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 <  }
120 >  static char buffer[IRCD_BUFSIZE / 4];
121 >  int bits = 0;
122  
123    SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), &bits);
124  
125 <  snprintf(buffer, sizeof(buffer), "%s %s-%d",
126 <           name, SSL_get_cipher(ssl), bits);
125 >  snprintf(buffer, sizeof(buffer), "%s %s-%d", SSL_get_version(ssl),
126 >           SSL_get_cipher(ssl), bits);
127    
128    return buffer;
129   }

Comparing:
ircd-hybrid/src/s_misc.c (property svn:keywords), Revision 32 by knight, Sun Oct 2 20:41:23 2005 UTC vs.
ircd-hybrid/trunk/src/s_misc.c (property svn:keywords), Revision 1793 by michael, Sun Mar 31 14:06:08 2013 UTC

# Line 1 | Line 1
1 < Revision
1 > Id Revision

Diff Legend

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