diff options
author | Adrian Vovk <adrianvovk@gmail.com> | 2024-09-04 05:45:08 +0200 |
---|---|---|
committer | Adrian Vovk <adrianvovk@gmail.com> | 2024-09-17 20:06:26 +0200 |
commit | e671bdc5c34a0d522edb40b3c35a7904bcdea26e (patch) | |
tree | c216f7738f7911681ea34ed92b20b06e5790caef /src | |
parent | Use correct error code in log message in output_waiting_jobs (#34404) (diff) | |
download | systemd-e671bdc5c34a0d522edb40b3c35a7904bcdea26e.tar.xz systemd-e671bdc5c34a0d522edb40b3c35a7904bcdea26e.zip |
strv: Fixup STRV_FOREACH_PAIR macro
The macro didn't properly parenthesize a caller-controlled argument.
For example: `STRV_FOREACH_PAIR(a, b, something ?: something_else)`
would expand to `typeof(*something ?: something_else)`, which would
cause compile failures
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/strv.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/strv.h b/src/basic/strv.h index bd90305e63..d38d5bf538 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -153,7 +153,7 @@ bool strv_overlap(char * const *a, char * const *b) _pure_; _STRV_FOREACH_BACKWARDS(s, l, UNIQ_T(h, UNIQ), UNIQ_T(i, UNIQ)) #define _STRV_FOREACH_PAIR(x, y, l, i) \ - for (typeof(*l) *x, *y, *i = (l); \ + for (typeof(*(l)) *x, *y, *i = (l); \ i && *(x = i) && *(y = i + 1); \ i += 2) |