I see nothing in the C standard specification of qsort() that says sorting an array with zero members leads to undefined behaviour.
The POSIX specification for qsort() is quite clear that sorting zero elements is safe.
The manual pages for Linux and macOS (BSD) do not specify that sorting zero elements leads to undefined behaviour.
Is there a platform where there is a known problem? If so, it would be worth documenting which platform/version explicitly so that the change can be undone in future if the recalcitrant platform(s) change their behaviour.
With all that said, the change is trivial — but could be improved by using the test if (nlinks > 1) so that the code doesn't call qsort for a single-element array either; that is already in sorted order, of course.