summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--op.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/op.h b/op.h
index e92b1d8db4..e55d5465ff 100644
--- a/op.h
+++ b/op.h
@@ -464,7 +464,7 @@ struct loop {
typedef struct {
struct tm* tmbuff;
} REBUF;
-#define localtime(a) localtime_r(a,PL_reentrant_buffer->tmbuff)
-#define gmtime(a) gmtime_r(a,PL_reentrant_buffer->tmbuff)
+#define localtime(a) (localtime_r(a,PL_reentrant_buffer->tmbuff) && PL_reentrant_buffer->tmbuff)
+#define gmtime(a) (gmtime_r(a,PL_reentrant_buffer->tmbuff) && PL_reentrant_buffer->tmbuff)
#endif