From 1daf1db8d416545ee59097baf8375ff49de4bfce Mon Sep 17 00:00:00 2001 From: das Date: Sun, 13 Jan 2008 02:11:10 +0000 Subject: Use size_t to avoid overflow when sorting arrays larger than 2 GB. PR: 111085 MFC after: 2 weeks --- lib/libc/stdlib/qsort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libc/stdlib/qsort.c') diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c index 65e038c..0958cd3 100644 --- a/lib/libc/stdlib/qsort.c +++ b/lib/libc/stdlib/qsort.c @@ -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; -- cgit v1.1