depot/pkgs/by-name/xa/xar/patches/0018-Replace-memcpy-with-memmove-for-musl.patch
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

25 lines
770 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ivan Trubach <mr.trubach@icloud.com>
Date: Tue, 30 Jul 2024 17:29:06 +0300
Subject: [PATCH 18/19] Replace memcpy with memmove for musl
---
xar/lib/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xar/lib/io.c b/xar/lib/io.c
index 64c69af..c962c4b 100644
--- a/xar/lib/io.c
+++ b/xar/lib/io.c
@@ -650,7 +650,7 @@ static int32_t flush_stream(xar_stream *stream) {
state->pending_buf = NULL;
} else if( state->pending_buf_size > len ) {
state->pending_buf_size -= len;
- memcpy(state->pending_buf, state->pending_buf + len, state->pending_buf_size);
+ memmove(state->pending_buf, state->pending_buf + len, state->pending_buf_size);
}
}
--
2.44.1