]> git.ipfire.org Git - thirdparty/git.git/commit - git-compat-util.h
add QSORT_S
authorRené Scharfe <l.s.r@web.de>
Sun, 22 Jan 2017 17:52:13 +0000 (18:52 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Jan 2017 19:02:36 +0000 (11:02 -0800)
commit3ca869940994866796edf9e53e52d80f82c3c04c
treef142a9dd9059877bc251038bed73f131f89f4733
parent04ee8b875b96c096c479132adca02fa734c3fa96
add QSORT_S

Add the macro QSORT_S, a convenient wrapper for qsort_s() that infers
the size of the array elements and dies on error.

Basically all possible errors are programming mistakes (passing NULL as
base of a non-empty array, passing NULL as comparison function,
out-of-bounds accesses), so terminating the program should be acceptable
for most callers.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-compat-util.h