Bug 252547

Summary: [PATCH] Fix an example to qsort.3
Product: Documentation Reporter: Hodong <hodong>
Component: Manual PagesAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: doc
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch for qsort.3 example none

Description Hodong 2021-01-09 21:27:54 UTC
Created attachment 221431 [details]
patch for qsort.3 example

Hello.
There seems to be a bug in the example in qsort.3.
Please review the following.
Thank you.

diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3
index 606185f9baee..22a0735af3a0 100644
--- a/lib/libc/stdlib/qsort.3
+++ b/lib/libc/stdlib/qsort.3
@@ -322,7 +322,7 @@ main(void)
        size_t array_size = sizeof(int_array) / sizeof(int_array[0]);
        size_t k;
 
-       qsort(&int_array, array_size, sizeof(int_array[0]), int_compare);
+       qsort(int_array, array_size, sizeof(int_array[0]), int_compare);
        for (k = 0; k < array_size; k++)
                printf(" %d", int_array[k]);
        puts("");
Comment 1 Hodong 2021-01-09 22:09:39 UTC
I was wrong. Sorry.