pivot-table: Use ctime_r() instead of ctime(), for thread safety.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 19 Oct 2019 05:57:32 +0000 (05:57 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 30 Oct 2019 22:41:21 +0000 (22:41 +0000)
src/output/pivot-table.c

index ba3d98c916ad3f798d8980f5a8562cee9e269f70..72a158baaad78a777935077475e529bf01285bb2 100644 (file)
@@ -1383,7 +1383,8 @@ pivot_table_dump (const struct pivot_table *table, int indentation)
   if (table->date)
     {
       indent (indentation);
-      printf ("date: %s", ctime (&table->date)); /* XXX thread unsafe */
+      char buf[26];
+      printf ("date: %s", ctime_r (&table->date, buf));
     }
 
   indent (indentation);