Coding style followups (#36476)

This commit is contained in:
Luca Boccassi
2025-02-21 21:58:54 +00:00
committed by GitHub
4 changed files with 7 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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);

View File

@@ -613,6 +613,8 @@ size_t utf8_console_width(const char *str) {
size_t utf8_last_length(const char *s, size_t n) {
int r;
assert(s);
if (n == SIZE_MAX)
n = strlen(s);