mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
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
This commit is contained in:
parent
d80a9042ca
commit
e671bdc5c3
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user