Make sure the empty tree exists when needed in merge-recursive.
[gitweb.git] / index-pack.c
index 042aea8842b531254e9a2d0ec67cbaeb40990575..6d6c92bf14803923f4c98678ae682aef4d41d3ab 100644 (file)
@@ -90,13 +90,13 @@ static SHA_CTX input_ctx;
 static int input_fd, output_fd, mmap_fd;
 
 /* Discard current buffer used content. */
-static void flush()
+static void flush(void)
 {
        if (input_offset) {
                if (output_fd >= 0)
                        write_or_die(output_fd, input_buffer, 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;
        }
 }