[PATCH 1/2] msvcrt: Added qsort_s implementation. (try 4)

Alexandre Julliard julliard at winehq.org
Fri Nov 12 05:08:23 CST 2010


"Vincas Miliūnas" <vincas.miliunas at gmail.com> writes:

> +/*********************************************************************
> + * Helper function for MSVCRT_qsort_s.
> + *
> + * Based on http://github.com/git/git/blob/master/compat/qsort.c
> + *
> + */

We already have a qsort in ntdll, I'd suggest to copy that (and/or merge
possible improvements into it). We don't need two implementations from
two different sources.

> +/*********************************************************************
> + * qsort_s (MSVCRT.@)
> + *
> + * Based on http://github.com/git/git/blob/master/compat/qsort.c
> + *
> + */
> +void CDECL MSVCRT_qsort_s(void *b, size_t n, size_t s,
> +    _QSORT_S_COMPARE_FN cmp, void *context)
> +{
> +    const size_t size = n * s;

You probably want to check for overflow.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list