]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/import-creds: use FOREACH_ARRAY at one more place
authorMike Yuan <me@yhndnzj.com>
Wed, 11 Sep 2024 15:20:50 +0000 (17:20 +0200)
committerMike Yuan <me@yhndnzj.com>
Sun, 9 Nov 2025 17:46:37 +0000 (18:46 +0100)
src/core/import-creds.c

index 99ec2a69b7e0d440c7c61998b7bf0bc58b173b97..0d830813939c2322717fc5e6ac7e0129dec8dd8a 100644 (file)
@@ -404,8 +404,8 @@ static int import_credentials_qemu(ImportCredentialsContext *c) {
                 return 0;
         }
 
-        for (size_t i = 0; i < de->n_entries; i++) {
-                const struct dirent *d = de->entries[i];
+        FOREACH_ARRAY(i, de->entries, de->n_entries) {
+                const struct dirent *d = *i;
                 _cleanup_close_ int vfd = -EBADF, rfd = -EBADF, nfd = -EBADF;
                 _cleanup_free_ char *szs = NULL;
                 uint64_t sz;