1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00

core: move assert before actual use of the variable

No point in using u->id first, and doing assert(u) later.
-std=c89 strikes again.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-06-26 11:52:57 +02:00
parent fa97f63067
commit 48f48b8c7c

View File

@ -244,6 +244,10 @@ int unit_full_printf(Unit *u, const char *format, char **ret) {
* before or after the relevant configuration setting. Hence: don't add them.
*/
assert(u);
assert(format);
assert(ret);
const Specifier table[] = {
{ 'n', specifier_string, u->id },
{ 'N', specifier_prefix_and_instance, NULL },
@ -281,9 +285,5 @@ int unit_full_printf(Unit *u, const char *format, char **ret) {
{}
};
assert(u);
assert(format);
assert(ret);
return specifier_printf(format, table, u, ret);
}