summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 55c5c9c952..454dffbb61 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -60,12 +60,13 @@ int ltdb_index_transaction_start(struct ldb_module *module)
* differences in string termination */
static int dn_list_cmp(const struct ldb_val *v1, const struct ldb_val *v2)
{
- int ret = strncmp((char *)v1->data, (char *)v2->data, v1->length);
- if (ret != 0) return ret;
- if (v2->length > v1->length && v2->data[v1->length] != 0) {
+ if (v1->length > v2->length && v1->data[v2->length] != 0) {
+ return -1;
+ }
+ if (v1->length < v2->length && v2->data[v1->length] != 0) {
return 1;
}
- return 0;
+ return strncmp((char *)v1->data, (char *)v2->data, v1->length);
}