From: Mike Yuan Date: Tue, 18 Feb 2025 13:32:30 +0000 (+0100) Subject: basic/strv: minor coding style follow-ups X-Git-Tag: v258-rc1~1276^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ab19c1f0a635e047f8826dc0616edd8c9be38c6;p=thirdparty%2Fsystemd.git basic/strv: minor coding style follow-ups Follow-up for 428146dc89506725f777ae82d288439340926a83 Addresses https://github.com/systemd/systemd/pull/36271#discussion_r1958334800 --- diff --git a/src/basic/strv.c b/src/basic/strv.c index d81c9f127c9..184804cea06 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -1239,14 +1239,14 @@ int strv_rebreak_lines(char **l, size_t width, char ***ret) { return 0; } -char** strv_filter_prefix(char *const*l, const char *prefix) { - _cleanup_strv_free_ char **f = NULL; +char** strv_filter_prefix(char * const *l, const char *prefix) { /* Allocates a copy of 'l', but only copies over entries starting with 'prefix' */ if (isempty(prefix)) return strv_copy(l); + _cleanup_strv_free_ char **f = NULL; size_t sz = 0; STRV_FOREACH(i, l) { diff --git a/src/basic/strv.h b/src/basic/strv.h index 64787237157..71aae2b20a8 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -269,4 +269,4 @@ int _string_strv_ordered_hashmap_put(OrderedHashmap **h, const char *key, const int strv_rebreak_lines(char **l, size_t width, char ***ret); -char** strv_filter_prefix(char *const*l, const char *prefix); +char** strv_filter_prefix(char * const *l, const char *prefix);