This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug manual/16838] New: 5.6 Collation Example: sort_strings_fast - qsort arguments out of order


https://sourceware.org/bugzilla/show_bug.cgi?id=16838

            Bug ID: 16838
           Summary: 5.6 Collation Example: sort_strings_fast - qsort
                    arguments out of order
           Product: glibc
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: manual
          Assignee: unassigned at sourceware dot org
          Reporter: drankinatty at suddenlinkmail dot com
                CC: mtk.manpages at gmail dot com, roland at gnu dot org

Guys,

  Here is an easy one for you. In section 5.6 of the libc manual, the example
given for the sort_strings_fast function contains the arguments for qsort in
the wrong order. The example shows:

void
sort_strings_fast (char **array, int nstrings)
{
    struct sorter temp_array[nstrings];
    int i;
<snip>
    /* Sort temp_array by comparing transformed strings. */
    qsort (temp_array, sizeof (struct sorter),
            nstrings, compare_elements);

should be:

    qsort (temp_array, nstrings,
            sizeof (struct sorter), compare_elements);


Thanks.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]