mirror of https://github.com/mkerrisk/man-pages
Add missing "const" qualifies to cast in EXAMPLE.
Slight rewording of comments in EXAMPLE.
This commit is contained in:
parent
e0037472fe
commit
7c5bd0ebc2
|
@ -84,11 +84,11 @@ which sorts the strings given in its command-line arguments:
|
|||
static int
|
||||
cmpstringp(const void *p1, const void *p2)
|
||||
{
|
||||
/* The arguments to this function are "pointers to
|
||||
/* The actual arguments to this function are "pointers to
|
||||
pointers to char", but strcmp() arguments are "pointers
|
||||
to char", hence the following cast plus dereference */
|
||||
|
||||
return strcmp(* (char **) p1, * (char **) p2);
|
||||
return strcmp(* (char * const *) p1, * (char * const *) p2);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in New Issue