summaryrefslogtreecommitdiffstats
path: root/src/dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2017-04-18 13:48:18 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2017-04-18 13:48:18 +0200
commit097541329828425a374210da147ce818b1d40e36 (patch)
treebdd422671c8e43bb1917531ecfc4c44de8850afa /src/dir.c
parenta1419a0806b4270bfad92ea496624b2edee5062c (diff)
MinGW: use localtime() instead of localtime_r()
Fix for a1419a0806b4270bfad92ea496624b2edee5062c
Diffstat (limited to 'src/dir.c')
-rw-r--r--src/dir.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dir.c b/src/dir.c
index 85b7689..7122d28 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -156,9 +156,13 @@ void mode_string (const unsigned int mode, char *str)
int set_datestr(char *datestr, size_t n, const time_t timev)
{
int test_date=0;
- struct tm tmp;
const struct tm *tm_p;
+#if defined(__MINGW32__)
+ if(timev!=0 && (tm_p= localtime(&timev))!=NULL)
+#else
+ struct tm tmp;
if(timev!=0 && (tm_p= localtime_r(&timev, &tmp))!=NULL)
+#endif
{
snprintf(datestr, n,"%2d-%s-%4d %02d:%02d",
tm_p->tm_mday, monstr[tm_p->tm_mon],