diff options
-rw-r--r-- | src/GCodes/GCodes.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp index e8ceed43..d0cf1c5d 100644 --- a/src/GCodes/GCodes.cpp +++ b/src/GCodes/GCodes.cpp @@ -4302,10 +4302,8 @@ bool GCodes::StartHash(const char* filename) noexcept GCodeResult GCodes::AdvanceHash(const StringRef &reply) noexcept { // Read and process some more data from the file - uint32_t buf32[(FILE_BUFFER_SIZE + 3) / 4]; - char *buffer = reinterpret_cast<char *>(buf32); - - int bytesRead = fileBeingHashed->Read(buffer, FILE_BUFFER_SIZE); + alignas(4) char buffer[FILE_BUFFER_SIZE]; + const int bytesRead = fileBeingHashed->Read(buffer, FILE_BUFFER_SIZE); if (bytesRead != -1) { SHA1Input(&hash, reinterpret_cast<const uint8_t *>(buffer), bytesRead); |