]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
another-time_t-pointer-fix-20060320
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 20 Mar 2006 13:38:36 +0000 (13:38 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 20 Mar 2006 13:38:36 +0000 (13:38 +0000)
do not pass in pointers to 32-bit values as pointers to 64-bit values

src/kauth/rebuild.c
src/lwp/test/selsubs.c

index 86241b16dcc9ce8962400c9bc795ce250a55171e..2d636893b1f620544c0602440106277bb12ab84e 100644 (file)
@@ -123,6 +123,7 @@ PrintEntry(index, entry)
     int i;
     char Time[100];
     struct tm *tm_p;
+    time_t tt;
 
     printf("\n");
 
@@ -171,7 +172,8 @@ PrintEntry(index, entry)
     if (entry->flags & KAFOLDKEYS)
        return;
 
-    tm_p = localtime((time_t *) & entry->user_expiration);
+    tt = entry->user_expiration;
+    tm_p = localtime(&tt);
     if (tm_p)
        strftime(Time, 100, "%m/%d/%Y %H:%M", tm_p);
 
@@ -285,8 +287,8 @@ RebuildEntry(entryp)
     if (strcmp(flags, "") != 0)
        fprintf(out, " -flags %s", &flags[1]);
     if (entryp->user_expiration != 0xffffffff) {
-       strftime(Time, 50, "%m/%d/%Y %H:%M",
-                localtime((time_t *) & entryp->user_expiration));
+       time_t tt = entryp->user_expiration;
+       strftime(Time, 50, "%m/%d/%Y %H:%M",localtime(&tt));
        fprintf(out, " -expiration '%s'", Time);
     }
     fprintf(out, " -lifetime %u", entryp->max_ticket_lifetime);
index f32e812250c5c1834c460d2a94b81869e03dadda..d318fa0bda970c5257c4b76c3ee72cd54f76e3ba 100644 (file)
@@ -150,6 +150,7 @@ Log(char *fmt, ...)
     struct timeval now;
     struct timezone tz;
     struct tm *ltime;
+    time_t tt;
     int code;
     PROCESS pid;
     extern char *program;
@@ -157,7 +158,8 @@ Log(char *fmt, ...)
     code = gettimeofday(&now, &tz);
     assert(code == 0);
 
-    ltime = localtime((time_t *) & now.tv_sec);
+    tt = now.tv_sec;
+    ltime = localtime(&tt);
 
     LWP_CurrentProcess(&pid);
     fprintf(stderr, "%s 0x%x %02d:%02d:%02d.%d: ", program ? program : "",