src/shared/util.h: update qsort_safe() for musl

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
This commit is contained in:
Anthony G. Basile 2015-05-27 12:42:05 -04:00
parent cf427188ad
commit 10647c881b

View File

@ -386,10 +386,11 @@ int unlink_noerrno(const char *path);
static inline void qsort_safe(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *)) {
if (nmemb) {
assert(base);
qsort(base, nmemb, size, compar);
}
if (nmemb <= 1)
return;
assert(base);
qsort(base, nmemb, size, compar);
}
int proc_cmdline(char **ret);