Browse Source

- Fix arguments to compare function. Closes #1081

Bernhard Reutner-Fischer 16 years ago
parent
commit
f73791df3a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libc/misc/search/_lsearch.c

+ 1 - 1
libc/misc/search/_lsearch.c

@@ -22,7 +22,7 @@ void *lfind(const void *key, const void *base, size_t *nmemb,
 	register int n = *nmemb;
 
 	while (n--) {
-		if ((*compar) (base, key) == 0)
+		if ((*compar) (key, base) == 0)
 			return ((void*)base);
 		base += size;
 	}