From 1a7f2a230d509df6f1f91bfea80c9b4b2c0df1bd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 31 Jul 2019 12:08:58 +1200 Subject: [PATCH] dsdb: Quiet CID 1452117 1452119 1452114 (STRAY_SEMICOLON) Try to make clear what is being done here, we are trying to count the partitions so that we can then walk them in reverse. Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- source4/dsdb/samdb/ldb_modules/partition.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 6a65726c181..6b0fbe728bc 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -1185,7 +1185,10 @@ int partition_end_trans(struct ldb_module *module) * partition_start_trans. See comment in that function for detail. */ if (data && data->partitions) { - for (i=0; data->partitions[i]; i++);; + /* Just counting the partitions */ + for (i=0; data->partitions[i]; i++) {} + + /* now walk them backwards */ for (i--; i>=0; i--) { struct dsdb_partition *p = data->partitions[i]; if (trace) { @@ -1241,7 +1244,10 @@ int partition_del_trans(struct ldb_module *module) * partition_start_trans. See comment in that function for detail. */ if (data->partitions) { - for (i=0; data->partitions[i]; i++);; + /* Just counting the partitions */ + for (i=0; data->partitions[i]; i++) {} + + /* now walk them backwards */ for (i--; i>=0; i--) { struct dsdb_partition *p = data->partitions[i]; if (trace) { @@ -1595,7 +1601,10 @@ int partition_read_unlock(struct ldb_module *module) * partition_start_trans. See comment in that function for detail. */ if (data && data->partitions) { - for (i=0; data->partitions[i]; i++);; + /* Just counting the partitions */ + for (i=0; data->partitions[i]; i++) {} + + /* now walk them backwards */ for (i--; i>=0; i--) { struct dsdb_partition *p = data->partitions[i]; if (trace) { -- 2.11.4.GIT