summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/common/util.c')
-rw-r--r--source4/lib/ldb/common/util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/util.c b/source4/lib/ldb/common/util.c
index 534d07c1df..22bbc8334e 100644
--- a/source4/lib/ldb/common/util.c
+++ b/source4/lib/ldb/common/util.c
@@ -85,10 +85,13 @@ int list_find(const void *needle,
}
return test_i;
}
- if (r == -1) {
+ if (r < 0) {
+ if (test_i == 0) {
+ return -1;
+ }
max_i = test_i - 1;
}
- if (r == 1) {
+ if (r > 0) {
min_i = test_i + 1;
}
}