summaryrefslogtreecommitdiff
path: root/src/sysctl
diff options
context:
space:
mode:
authorSimon Peeters <peeters.simon@gmail.com>2014-01-04 02:35:27 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-05 09:16:15 -0500
commite3e45d4f82daa5cd85ba40dde9127df900096c0c (patch)
tree307e427adfd64298ff3f21f6c6fd97aca1e17d42 /src/sysctl
parentbf85c24daaf63f72562bbe4c627ca8b963dfb964 (diff)
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
Diffstat (limited to 'src/sysctl')
-rw-r--r--src/sysctl/sysctl.c6
1 files changed, 1 insertions, 5 deletions
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;
}