[Bug 252547] [PATCH] Fix an example to qsort.3

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Jan 9 21:27:55 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252547

            Bug ID: 252547
           Summary: [PATCH] Fix an example to qsort.3
           Product: Documentation
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Manual Pages
          Assignee: bugs at FreeBSD.org
          Reporter: hodong at nimfsoft.com
                CC: doc at FreeBSD.org

Created attachment 221431
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=221431&action=edit
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("");

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the freebsd-doc mailing list