Fix printing of date with rating
[capablanca.git] / lasker-2.2.3 / src / comproc.c
index 97522e0..0487f88 100644 (file)
@@ -125,9 +125,10 @@ static void com_stats_rating(char *hdr, struct statistics * stats, char *dest, l
          ratstr(stats->rating), current_sterr(stats->sterr, now-stats->ltime),
           stats->win, stats->los, stats->dra, stats->num);
   if (stats->whenbest) {
+    time_t besttime = stats->whenbest; // [HGM] time_t could have larger size than int, so don't pass localtime a pointer to it
     sprintf(tmp, "   %d", stats->best);
     strcat(dest, tmp);
-    strftime(tmp, sizeof(tmp), " (%d-%b-%Y)", localtime((time_t *) & stats->whenbest));
+    strftime(tmp, sizeof(tmp), " (%d-%b-%Y)", localtime(&besttime));
     strcat(dest, tmp);
   }
   strcat(dest, "\n");