From ca5d8bf84291df99c6ef211aa03e1fe909f8b544 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 29 Sep 2025 14:47:09 +0100 Subject: [PATCH] Fix memcpy destination offset in writing buffer to ensure correct data placement --- src/write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write.c b/src/write.c index 23c2391..3fd27a7 100644 --- a/src/write.c +++ b/src/write.c @@ -112,7 +112,7 @@ int32_t aaruf_write_sector(void *context, uint64_t sectorAddress, uint8_t *data, } TRACE("Copying data to writing buffer at position %zu", ctx->writingBufferPosition); - memcpy(ctx->writingBuffer, data, length); + memcpy(ctx->writingBuffer + ctx->writingBufferPosition, data, length); TRACE("Advancing writing buffer position to %zu", ctx->writingBufferPosition + length); ctx->writingBufferPosition += length; TRACE("Advancing current block offset to %zu", ctx->currentBlockOffset + 1);