summaryrefslogtreecommitdiff
path: root/lang/afnix/files/patch-src_plt_lib_cclk.cxx
blob: eeb4caa1971f373c28cc76fd81341a9a5f055ce0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- src/plt/lib/cclk.cxx.orig	Wed Jan 12 06:05:00 2005
+++ src/plt/lib/cclk.cxx	Wed Feb 16 19:18:04 2005
@@ -53,7 +53,8 @@
   s_tinfo* c_getlocal (const long tclk) {
     // extract time info
     struct tm* tval;
-    if ((tval = localtime (&tclk)) == NULL) return 0;
+    time_t t = tclk;
+    if (t != tclk || (tval = localtime (&t)) == NULL) return 0;
     // fill in the data structure
     s_tinfo* tinfo = new s_tinfo;
     tinfo->d_secs = tval->tm_sec;
@@ -72,7 +73,8 @@
   s_tinfo* c_getutc (const long tclk) {
     // extract time info
     struct tm* tval;
-    if ((tval = gmtime (&tclk)) == NULL) return 0;
+    time_t t = tclk;
+    if (t != tclk || (tval = gmtime (&t)) == NULL) return 0;
     // fill in the data structure
     s_tinfo* tinfo = new s_tinfo;
     tinfo->d_secs = tval->tm_sec;