summarylogtreecommitdiffstats
path: root/Fix-incorrect-pointer-and-change-to-time_t.patch
blob: bde3a4695c8d49604c25d4c1a0eb68385d9a70d8 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff --git a/tws.c b/tws.c
index cbafeb2..4e601d5 100644
--- a/tws.c
+++ b/tws.c
@@ -37,17 +37,16 @@ extern long timezone;
 #include <sys/timeb.h>
 #endif /*SYS5*/
 
-extern long time();
 struct tm* localtime();
 
 struct tws *dtwstime()
 {
-   long clock = 0;
+   time_t clock = 0;
    char *phoontime = getenv( "PHOONTIME" );
    
    if( phoontime )
    {
-      clock = strtol( phoontime, 0, 0 );
+      clock = strtol( phoontime, NULL, 0 );
    }
 
    if( !clock )
@@ -57,7 +56,7 @@ struct tws *dtwstime()
    return dlocaltime( &clock );
 }
 
-struct tws* dlocaltime( long* clock )
+struct tws* dlocaltime( const time_t *clock )
 {
 register struct tm* tm;
 #ifndef SYS5
@@ -65,8 +64,10 @@ register struct tm* tm;
 #endif /*not SYS5*/
    static struct tws tw;
    
-   if ( clock == (long*) 0 )
-      return (struct tws*) 0;
+   if ( !clock )
+   {
+     return NULL;
+   }
    tw.tw_flags = TW_NULL;
    
    tm = localtime( clock );