mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] qsort: Fix wrong check
@ 2012-08-03  6:30 Sascha Hauer
  2012-08-03  6:30 ` [PATCH 2/2] glob: fix GLOB_SORT Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2012-08-03  6:30 UTC (permalink / raw)
  To: barebox; +Cc: jbe

The check for overflow accidently was exactly the opposite.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-03  6:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-03  6:30 [PATCH 1/2] qsort: Fix wrong check Sascha Hauer
2012-08-03  6:30 ` [PATCH 2/2] glob: fix GLOB_SORT Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox