From 7c5bd0ebc2b7dd8a750e408ff7ff508d6140d1a9 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 8 May 2006 06:41:59 +0000 Subject: [PATCH] Add missing "const" qualifies to cast in EXAMPLE. Slight rewording of comments in EXAMPLE. --- man3/qsort.3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man3/qsort.3 b/man3/qsort.3 index a1e6bea73..0886adba6 100644 --- a/man3/qsort.3 +++ b/man3/qsort.3 @@ -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