Serious 'tr' bug, patch for review included

Andrey Chernov ache at
Thu Jul 31 19:12:16 PDT 2003

On Fri, Aug 01, 2003 at 12:02:04 +1000, Tim Robbins wrote:

> 8 bits by casting to char. Using charcoll() to sort char arrays may
> work on little endian machines, but may not on big endian machines.

s->set is array of ints, not array of chars. In any case thanx for 

> Also, watch out for this warning in qsort(3):
>      The qsort() and heapsort() functions sort an array of nmemb objects, the
>      initial member of which is pointed to by base.  The size of each object
>      is specified by size.  Mergesort() behaves similarly, but requires that
>      size be greater than ``sizeof(void *) / 2''.
>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Its elements are size of int, which conform this condition.

BTW, I plan to repost slightly revised version of the patch in few 
minutes, because found that skipping needs more complex processing.

More information about the freebsd-current mailing list