Add missing "const" qualifies to cast in EXAMPLE.

Slight rewording of comments in EXAMPLE.
This commit is contained in:
Michael Kerrisk 2006-05-08 06:41:59 +00:00
parent e0037472fe
commit 7c5bd0ebc2
1 changed files with 2 additions and 2 deletions

View File

@ -84,11 +84,11 @@ which sorts the strings given in its command-line arguments:
static int static int
cmpstringp(const void *p1, const void *p2) 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 pointers to char", but strcmp() arguments are "pointers
to char", hence the following cast plus dereference */ to char", hence the following cast plus dereference */
return strcmp(* (char **) p1, * (char **) p2); return strcmp(* (char * const *) p1, * (char * const *) p2);
} }
int int