From: Benjamin Robin Date: Sun, 10 May 2020 16:33:16 +0000 (+0200) Subject: basic: Allow to call STRV_FOREACH_BACKWARDS() with a char * const * strv X-Git-Tag: v246-rc1~374^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=147d8fc1a7b9e16c3537588b700a9f3f97c40b08;p=thirdparty%2Fsystemd.git basic: Allow to call STRV_FOREACH_BACKWARDS() with a char * const * strv --- diff --git a/src/basic/strv.h b/src/basic/strv.h index 0837e65a183..0f81e345800 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -106,7 +106,7 @@ bool strv_overlap(char * const *a, char * const *b) _pure_; #define STRV_FOREACH_BACKWARDS(s, l) \ for (s = ({ \ - char **_l = l; \ + typeof(l) _l = l; \ _l ? _l + strv_length(_l) - 1U : NULL; \ }); \ (l) && ((s) >= (l)); \