Use size_t to avoid overflow when sorting arrays larger than 2 GB.
PR: 111085 MFC after: 2 weeks
This commit is contained in:
parent
c6eabb5ec1
commit
badf97cd55
@ -141,7 +141,7 @@ heapsort(vbase, nmemb, size, compar)
|
||||
size_t nmemb, size;
|
||||
int (*compar)(const void *, const void *);
|
||||
{
|
||||
int cnt, i, j, l;
|
||||
size_t cnt, i, j, l;
|
||||
char tmp, *tmp1, *tmp2;
|
||||
char *base, *k, *p, *t;
|
||||
|
||||
|
@ -111,7 +111,8 @@ qsort(void *a, size_t n, size_t es, cmp_t *cmp)
|
||||
#endif
|
||||
{
|
||||
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
|
||||
int d, r, swaptype, swap_cnt;
|
||||
size_t d, r;
|
||||
int swaptype, swap_cnt;
|
||||
|
||||
loop: SWAPINIT(a, es);
|
||||
swap_cnt = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user