From e3e45d4f82daa5cd85ba40dde9127df900096c0c Mon Sep 17 00:00:00 2001 From: Simon Peeters Date: Sat, 4 Jan 2014 02:35:27 +0100 Subject: strv: multiple cleanups - turn strv_merge into strv_extend_strv. appending strv b to the end of strv a instead of creating a new strv - strv_append: remove in favor of strv_extend and strv_push. - strv_remove: write slightly more elegant - strv_remove_prefix: remove unused function - strv_overlap: use strv_contains - strv_printf: STRV_FOREACH handles NULL correctly --- src/sysctl/sysctl.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/sysctl/sysctl.c') diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index 7ebe1e2df5..57112a7ef9 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -251,13 +251,9 @@ static int parse_argv(int argc, char *argv[]) { if (*p == '.') *p = '/'; - l = strv_append(arg_prefixes, optarg); - if (!l) + if (strv_extend(&arg_prefixes, optarg) < 0) return log_oom(); - strv_free(arg_prefixes); - arg_prefixes = l; - break; } -- cgit v1.2.3-54-g00ecf