However, I think that TZ code can sidestep the whole issue by using:if (nlinks > 1)qsort(links, nlinks, sizeof(*links), qsort_linkcmp);There's no need to sort arrays of size 0 or 1. This avoids any questions about whether a count of zero is valid as an argument to qsort().