On Tue, Jul 05, 2016 at 02:15:32PM +0200, Dominique Dumont wrote: > As far as I understand qsort doc, you call this function with a array of > strings (char *), i.e. a char**. > > cmpstringp is called with an object from the array, i.e. a void pointer to a > char *. I don't think dereferecing the pointer is safe.
The arguments to the comparison function are pointers to char* (i.e. char**), so dereferencing them will pass the char* pointers from the char **cfh_list list to strcmp. It's passing pointers to the compared objects to the comparison function as the objects don't necessarily need to be pointers.
signature.asc
Description: Digital signature

