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
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
bf85c24daa
commit
e3e45d4f82
@@ -64,13 +64,9 @@ static int add_modules(const char *p) {
|
||||
if (!k)
|
||||
return log_oom();
|
||||
|
||||
t = strv_merge(arg_proc_cmdline_modules, k);
|
||||
if (!t)
|
||||
if (strv_extend_strv(&arg_proc_cmdline_modules, k) < 0)
|
||||
return log_oom();
|
||||
|
||||
strv_free(arg_proc_cmdline_modules);
|
||||
arg_proc_cmdline_modules = t;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user