summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5805214)
ctime_r() isn't in mingw or Gnulib and it's best to avoid it in any
case because POSIX says it is obsolescent and it has buffer overflow
issues.
Reported by Harry Thijssen.
if (table->date)
{
indent (indentation);
if (table->date)
{
indent (indentation);
- char buf[26];
- printf ("date: %s", ctime_r (&table->date, buf));
+
+ struct tm *tm = localtime (&table->date);
+ printf ("date: %d-%02d-%02d %d:%02d:%02d\n", tm->tm_year + 1900,
+ tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min,
+ tm->tm_sec);