Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvpair_sort: sanity check to forbid NULL pointer
Technically, we're not allowed to pass NULL to qsort(), even if nmemb==0: Where an argument declared as size_t nmemb specifies the length of the array for a function, nmemb can have the value zero... Pointer arguments on such a call shall still have valid values, as described in 7.1.4. C99, 7.20.5/1 Searching and sorting utilities and: If an argument to a function has an invalid value (such as... a null pointer...) ... the behavior is undefined. C99, 7.1.4/1 Use of library functions
- Loading branch information