浏览代码

- Fix arguments to compare function. Closes #1081

Bernhard Reutner-Fischer 17 年之前
父节点
当前提交
f73791df3a
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;
 	}