]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: let's use FOREACH_ARRAY() at once very obvious place 28760/head
authorLennart Poettering <lennart@poettering.net>
Thu, 10 Aug 2023 10:13:46 +0000 (12:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 10 Aug 2023 10:13:46 +0000 (12:13 +0200)
src/coredump/coredump.c

index 9a2066858d3b05b88a8ec9bce3f985edcd28c182..659eae3b3e780a1468c20ca624cec295912a9643 100644 (file)
@@ -1473,11 +1473,8 @@ static int process_backtrace(int argc, char *argv[]) {
                 /* The imported iovecs are not supposed to be freed by us so let's store
                  * them at the end of the array so we can skip them while freeing the
                  * rest. */
-                for (size_t i = 0; i < importer.iovw.count; i++) {
-                        struct iovec *iovec = importer.iovw.iovec + i;
-
+                FOREACH_ARRAY(iovec, importer.iovw.iovec, importer.iovw.count)
                         iovw_put(iovw, iovec->iov_base, iovec->iov_len);
-                }
         }
 
         r = sd_journal_sendv(iovw->iovec, iovw->count);