mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
systemctl: minor coding style fixes
This commit is contained in:
parent
37370d0cbe
commit
a33fdebb30
@ -3552,23 +3552,25 @@ finish:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int mangle_names(char **original_names, char ***mangled_names) {
|
static int mangle_names(char **original_names, char ***mangled_names) {
|
||||||
char **names_it = NULL;
|
char **i, **l, **name;
|
||||||
char **name = NULL;
|
|
||||||
|
|
||||||
(*mangled_names) = new(char*, strv_length(original_names)+1);
|
l = new(char*, strv_length(original_names) + 1);
|
||||||
if(!(*mangled_names))
|
if (!l)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
names_it = *mangled_names;
|
i = l;
|
||||||
|
|
||||||
STRV_FOREACH(name, original_names) {
|
STRV_FOREACH(name, original_names) {
|
||||||
char *n = unit_name_mangle(*name);
|
*i = unit_name_mangle(*name);
|
||||||
(*names_it) = n ? n : strdup(*name);
|
if (!*i) {
|
||||||
if(!(*names_it))
|
strv_free(l);
|
||||||
return log_oom();
|
return log_oom();
|
||||||
names_it++;
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
*names_it = NULL;
|
|
||||||
|
*i = NULL;
|
||||||
|
*mangled_names = l;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user