[PATCH 1/2] qsort: Fix wrong check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The check for overflow accidently was exactly the opposite.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 lib/qsort.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/qsort.c b/lib/qsort.c
index f648714..d413096 100644
--- a/lib/qsort.c
+++ b/lib/qsort.c
@@ -31,7 +31,7 @@ void qsort(void  *base,
 		return;
 
 	/* check for overflow */
-	if (nel <= ((size_t)(-1)) / width)
+	if (nel > ((size_t)(-1)) / width)
 		return;
 
 	wgap = 0;
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux