Fixed time magic.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@311 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-03-18 01:47:34 +00:00
parent 116bc3cde4
commit 2f88ff228a

7
d.c
View File

@@ -174,8 +174,7 @@ der_get_generalizedtime (Buffer *b, void *val)
time_t *t = (time_t *)val;
int len;
krb5_data str;
struct tm tm;
extern long timezone;
struct tm tm, *tm2;
len = der_get_octetstring (b, &str);
sscanf (str.data, "%04d%02d%02d%02d%02d%02dZ",
@@ -186,8 +185,10 @@ der_get_generalizedtime (Buffer *b, void *val)
tm.tm_isdst = 0;
*t = mktime (&tm);
*t -= timezone;
tm2 = gmtime (t);
*t += *t - mktime (tm2);
string_free (str);
return len;
}