diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-06-26 11:52:57 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-06-26 16:24:48 +0200 |
commit | 48f48b8c7cfbbea44eca91eb21e408dfeb9e22a9 (patch) | |
tree | a3bfbd8603e7232333f73b99637d08894f304e73 /src/core/unit-printf.c | |
parent | fa97f63067a05b4e793fd4e0a2b54797459b4812 (diff) | |
download | systemd-48f48b8c7cfbbea44eca91eb21e408dfeb9e22a9.tar.gz |
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.
Diffstat (limited to 'src/core/unit-printf.c')
-rw-r--r-- | src/core/unit-printf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c index 72391ace3a..ffa12d8a92 100644 --- a/src/core/unit-printf.c +++ b/src/core/unit-printf.c @@ -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); } |