1
0
mirror of synced 2025-01-18 17:14:13 +01:00

Merge pull request #3 from misson20000/bugfixes

a few bugfixes
This commit is contained in:
WerWolv 2020-11-23 08:25:15 +01:00 committed by GitHub
commit 788a3cfc5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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");

View File

@ -137,7 +137,7 @@ namespace hex {
size_t copySize = (end - start) + 1;
std::string buffer;
std::string buffer(copySize, 0x00);
buffer.reserve(copySize + 1);
this->m_dataProvider->read(start, buffer.data(), copySize);