Skip to content

Commit

Permalink
avoid copy_n
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Jul 2, 2023
1 parent 9215f74 commit 4c4bf7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pgfimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void PgfImage::doWriteMetadata(BasicIo& outIo) {
// Write new Header size.
auto newHeaderSize = static_cast<uint32_t>(header.size() + imgSize);
DataBuf buffer(4);
std::copy_n(&newHeaderSize, 4, buffer.data());
*reinterpret_cast<uint32_t*>(buffer.data()) = newHeaderSize;
byteSwap_(buffer, 0, bSwap_);
if (outIo.write(buffer.c_data(), 4) != 4)
throw Error(ErrorCode::kerImageWriteFailed);
Expand Down

0 comments on commit 4c4bf7c

Please sign in to comment.