diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-05-08 12:30:51 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-05-08 22:47:50 +0200 |
commit | 2034c8b8838c9f42d1dc16fbda23d9bc3a2c6f02 (patch) | |
tree | f9c20df0ff36af4a0edcb6f6ecb42e16f41be116 /src/test/test-fs-util.c | |
parent | fuzz-journal-remote: allow -ENODATA too (diff) | |
download | systemd-2034c8b8838c9f42d1dc16fbda23d9bc3a2c6f02.tar.xz systemd-2034c8b8838c9f42d1dc16fbda23d9bc3a2c6f02.zip |
tree-wide: drop de-constifying casts for strv iteration
When the the iterator variable is declared automatically, it "inherits" the
const/non-const status from the argument. We don't need to cast a const
table to non-const. If we had a programming error and tried to modify the
string, the compiler could now catch this.
Diffstat (limited to 'src/test/test-fs-util.c')
-rw-r--r-- | src/test/test-fs-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-fs-util.c b/src/test/test-fs-util.c index f24e97b4cc..5d9d99e272 100644 --- a/src/test/test-fs-util.c +++ b/src/test/test-fs-util.c @@ -712,7 +712,7 @@ TEST(rename_noreplace) { j = strjoina(z, table[4]); (void) symlink("foobar", j); - STRV_FOREACH(a, (char**) table) { + STRV_FOREACH(a, table) { _cleanup_free_ char *x = NULL, *y = NULL; x = strjoin(z, *a); @@ -723,7 +723,7 @@ TEST(rename_noreplace) { continue; } - STRV_FOREACH(b, (char**) table) { + STRV_FOREACH(b, table) { _cleanup_free_ char *w = NULL; w = strjoin(z, *b); |