From 96e895efaf7b381e7fab68b7b6c49367634c17d1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 6 Mar 2019 19:22:33 +0100 Subject: [PATCH] systemctl: use strv_consume() where appropriate --- src/systemctl/systemctl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 03dea764cc6..a88dd839298 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -8023,9 +8023,8 @@ static int systemctl_parse_argv(int argc, char *argv[]) { } if (unit_type_from_string(type) >= 0) { - if (strv_push(&arg_types, type) < 0) + if (strv_consume(&arg_types, TAKE_PTR(type)) < 0) return log_oom(); - type = NULL; continue; } @@ -8034,9 +8033,8 @@ static int systemctl_parse_argv(int argc, char *argv[]) { * in --types= too for compatibility * with old versions */ if (unit_load_state_from_string(type) >= 0) { - if (strv_push(&arg_states, type) < 0) + if (strv_consume(&arg_states, TAKE_PTR(type)) < 0) return log_oom(); - type = NULL; continue; } -- 2.47.3