summaryrefslogtreecommitdiffstats
path: root/web/attachments/396772-sslutils_proper_date.patch
blob: 6e0ebe0d0d9e92fdf433680e51f9dbd3e7dacb48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- sslutils.c	2010-12-23 09:23:37.000000000 +1100
+++ sslutils.c.orig	2009-05-22 07:11:51.000000000 +1000
@@ -102,8 +102,7 @@
 	struct tm stamp;
 	float time_left;
 	int days_left;
-//	char timestamp[17] = "";
-	char *timestamp;
+	char timestamp[17] = "";
 
 	certificate=SSL_get_peer_certificate(s);
 	if(! certificate){
@@ -150,13 +149,10 @@
 
 	time_left = difftime(timegm(&stamp), time(NULL));
 	days_left = time_left / 86400;
-/*
 	snprintf
 		(timestamp, 17, "%02d/%02d/%04d %02d:%02d",
 		 stamp.tm_mon + 1,
 		 stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min);
-*/
-	timestamp = asctime(&stamp);
 
 	if (days_left > 0 && days_left <= days_till_exp) {
 		printf (_("WARNING - Certificate expires in %d day(s) (%s).\n"), days_left, timestamp);