From 7cf69128ea19d45524fbce5a39a7b653d39dbac9 Mon Sep 17 00:00:00 2001 From: misson20000 Date: Sun, 22 Nov 2020 18:00:17 -0800 Subject: [PATCH] Actually fix time_t decoding crash on Linux --- source/views/view_data_inspector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/views/view_data_inspector.cpp b/source/views/view_data_inspector.cpp index 8226b5290..185adab26 100644 --- a/source/views/view_data_inspector.cpp +++ b/source/views/view_data_inspector.cpp @@ -92,7 +92,7 @@ namespace hex { auto endianAdjustedTime = hex::changeEndianess(this->m_previewData.time, this->m_endianess); std::tm * ptm = localtime(&endianAdjustedTime); char buffer[64]; - if (std::strftime(buffer, 64, "%a, %d.%m.%Y %H:%M:%S", ptm) != 0) + if (ptm != nullptr && std::strftime(buffer, 64, "%a, %d.%m.%Y %H:%M:%S", ptm) != 0) this->m_cachedData.emplace_back("time_t", buffer); else this->m_cachedData.emplace_back("time_t", "Invalid");