dsdb: Quiet CID 1452117 1452119 1452114 (STRAY_SEMICOLON)
authorAndrew Bartlett <abartlet@samba.org>
Wed, 31 Jul 2019 00:08:58 +0000 (12:08 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 1 Aug 2019 05:01:15 +0000 (05:01 +0000)
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 <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/partition.c

index 6a65726c18175959f4925be1f6f51a1ade6dd787..6b0fbe728bce594ed4ce88c34045350ba5cd04a3 100644 (file)
@@ -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) {