]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-journal: use FOREACH_ARRAY() at one more place 30567/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 21 Dec 2023 16:28:44 +0000 (01:28 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 21 Dec 2023 16:28:44 +0000 (01:28 +0900)
src/libsystemd/sd-journal/sd-journal.c

index 6b9ff0a4ed880557b940a9d37b79ca88119c6b6b..f2a0c666703be94be7657459414e99ad453c0a69 100644 (file)
@@ -932,8 +932,8 @@ static int real_journal_next(sd_journal *j, direction_t direction) {
         if (r < 0)
                 return r;
 
-        for (unsigned i = 0; i < n_files; i++) {
-                JournalFile *f = (JournalFile *)files[i];
+        FOREACH_ARRAY(_f, files, n_files) {
+                JournalFile *f = (JournalFile*) *_f;
                 bool found;
 
                 r = next_beyond_location(j, f, direction);