"Vincas Miliƫnas" <vincas.miliu...@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 julli...@winehq.org