Use memmove instead of memcpy for overlapping areas
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
6dcfa306f2
commit
79a65697be
@ -30,7 +30,7 @@ static void * fill(int min)
|
||||
die("cannot fill %d bytes", min);
|
||||
if (offset) {
|
||||
SHA1_Update(&ctx, buffer, offset);
|
||||
memcpy(buffer, buffer + offset, len);
|
||||
memmove(buffer, buffer + offset, len);
|
||||
offset = 0;
|
||||
}
|
||||
do {
|
||||
|
@ -61,7 +61,7 @@ static void * fill(int min)
|
||||
die("cannot fill %d bytes", min);
|
||||
if (input_offset) {
|
||||
SHA1_Update(&input_ctx, input_buffer, input_offset);
|
||||
memcpy(input_buffer, input_buffer + input_offset, input_len);
|
||||
memmove(input_buffer, input_buffer + input_offset, input_len);
|
||||
input_offset = 0;
|
||||
}
|
||||
do {
|
||||
|
Loading…
Reference in New Issue
Block a user