summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDjalal Harouni <tixxdz@opendz.org>2013-12-17 19:42:00 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-18 23:58:24 -0500
commit1c3051eba4f2a3cbb8417f8d2e11699a67987700 (patch)
treebb46c1fc5f5ac20f36d4aae29a761c3a9405989b /src
parentc736283bfb81f5b00756e08a13946c113a41527f (diff)
loginctl: replace strv_append() by strv_extend()
Diffstat (limited to 'src')
-rw-r--r--src/login/loginctl.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index f96a568610..e03b0b93e1 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -1089,7 +1089,7 @@ static int parse_argv(int argc, char *argv[]) {
{}
};
- int c;
+ int c, r;
assert(argc >= 0);
assert(argv);
@@ -1107,14 +1107,9 @@ static int parse_argv(int argc, char *argv[]) {
return 0;
case 'p': {
- char **l;
-
- l = strv_append(arg_property, optarg);
- if (!l)
- return -ENOMEM;
-
- strv_free(arg_property);
- arg_property = l;
+ r = strv_extend(&arg_property, optarg);
+ if (r < 0)
+ return log_oom();
/* If the user asked for a particular
* property, show it to him, even if it is