chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c736283
)
loginctl: replace strv_append() by strv_extend()
author
Djalal Harouni
<tixxdz@opendz.org>
Tue, 17 Dec 2013 18:42:00 +0000
(19:42 +0100)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Thu, 19 Dec 2013 04:58:24 +0000
(23:58 -0500)
src/login/loginctl.c
patch
|
blob
|
history
diff --git
a/src/login/loginctl.c
b/src/login/loginctl.c
index f96a568610b07e78be5bb3784842ab064f875b9b..e03b0b93e19f54b1b9460a79d1e4abc1ab1565b0 100644
(file)
--- 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