]> git.ipfire.org Git - thirdparty/git.git/commit - apply.c
apply: use COPY_ARRAY and MOVE_ARRAY in update_image()
authorRené Scharfe <l.s.r@web.de>
Sat, 15 Jul 2017 20:20:54 +0000 (22:20 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Jul 2017 21:55:10 +0000 (14:55 -0700)
commit177366415b95fb72bc2c37d55a936ff101986285
tree51a96546371b788e5e11e4e28dddcb60a372a079
parentf331ab9d4cb21942dcde6d879aaca6a1784e8cb6
apply: use COPY_ARRAY and MOVE_ARRAY in update_image()

Simplify the code by using the helper macros COPY_ARRAY and MOVE_ARRAY,
which also makes them more robust in the case we copy or move no lines,
as they allow using NULL points in that case, while memcpy(3) and
memmove(3) don't.

Found with Clang's UBSan.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
apply.c