Replace ldb_search() with ldb_search_exp_fmt(), like in Samba 4.
[kai/samba-autobuild/.git] / source3 / lib / ldb / tools / ldbtest.c
index 637eb5a7ff23370d8b475b2384661ba1615175db..5e8ef1b21cc2ef7a19071f38efec5e0835db975d 100644 (file)
@@ -220,20 +220,18 @@ static void search_uid(struct ldb_context *ldb, struct ldb_dn *basedn, int nreco
 
        for (i=0;i<nsearches;i++) {
                int uid = (i * 700 + 17) % (nrecords * 2);
-               char *expr;
                struct ldb_result *res = NULL;
                int ret;
 
-               expr = talloc_asprintf(ldb, "(uid=TEST%d)", uid);
-               ret = ldb_search(ldb, ldb, &res, basedn, LDB_SCOPE_SUBTREE, NULL, expr);
+               ret = ldb_search(ldb, ldb, &res, basedn, LDB_SCOPE_SUBTREE, NULL, "(uid=TEST%d)", uid);
 
                if (ret != LDB_SUCCESS || (uid < nrecords && res->count != 1)) {
-                       printf("Failed to find %s - %s\n", expr, ldb_errstring(ldb));
+                       printf("Failed to find TEST%d - %s\n", uid, ldb_errstring(ldb));
                        exit(1);
                }
 
                if (uid >= nrecords && res->count > 0) {
-                       printf("Found %s !? - %d\n", expr, ret);
+                       printf("Found TEST%d !? - %d\n", uid, ret);
                        exit(1);
                }