summaryrefslogtreecommitdiff
path: root/source4/torture/local
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-02-27 09:08:17 +0100
committerAndrew Bartlett <abartlet@samba.org>2014-04-02 09:03:45 +0200
commit2f0f7af39cb72d421122676225b3ff4c4577d076 (patch)
treefafe112da0ad4d02a1b821ef439b0532146389fb /source4/torture/local
parente794206ed0e313828a6c751695864e96db36ba66 (diff)
downloadsamba-2f0f7af39cb72d421122676225b3ff4c4577d076.tar.gz
s4:torture/local: only pass prefix strings to tdb_add_record() in dbspeed.c
This way the compiler has a chance to check the format string. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/torture/local')
-rw-r--r--source4/torture/local/dbspeed.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source4/torture/local/dbspeed.c b/source4/torture/local/dbspeed.c
index e0c132e3f28..1800ace04f0 100644
--- a/source4/torture/local/dbspeed.c
+++ b/source4/torture/local/dbspeed.c
@@ -32,15 +32,15 @@
float tdb_speed;
-static bool tdb_add_record(struct tdb_wrap *tdbw, const char *fmt1,
- const char *fmt2, int i)
+static bool tdb_add_record(struct tdb_wrap *tdbw, const char *p1,
+ const char *p2, int i)
{
TDB_DATA key, data;
int ret;
- key.dptr = (uint8_t *)talloc_asprintf(tdbw, fmt1, i);
+ key.dptr = (uint8_t *)talloc_asprintf(tdbw, "%s%u", p1, i);
key.dsize = strlen((char *)key.dptr)+1;
- data.dptr = (uint8_t *)talloc_asprintf(tdbw, fmt2, i+10000);
+ data.dptr = (uint8_t *)talloc_asprintf(tdbw, "%s%u", p2, i+10000);
data.dsize = strlen((char *)data.dptr)+1;
ret = tdb_store(tdbw->tdb, key, data, TDB_INSERT);
@@ -77,14 +77,14 @@ static bool test_tdb_speed(struct torture_context *torture, const void *_data)
for (i=0;i<torture_entries;i++) {
if (!tdb_add_record(tdbw,
- "S-1-5-21-53173311-3623041448-2049097239-%u",
- "UID %u", i)) {
+ "S-1-5-21-53173311-3623041448-2049097239-",
+ "UID ", i)) {
torture_result(torture, TORTURE_FAIL, "Failed to add SID %d!", i);
goto failed;
}
if (!tdb_add_record(tdbw,
- "UID %u",
- "S-1-5-21-53173311-3623041448-2049097239-%u", i)) {
+ "UID ",
+ "S-1-5-21-53173311-3623041448-2049097239-", i)) {
torture_result(torture, TORTURE_FAIL, "Failed to add UID %d!", i);
goto failed;
}