diff options
author | Jan Synacek <jsynacek@redhat.com> | 2019-07-31 16:13:35 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-31 16:13:35 +0200 |
commit | 28a06f5abe7acda656954627d483715478310927 (patch) | |
tree | 71e10ae2c0c08811781243b223933c559efa3924 | |
parent | 1be8044b5bf837d5344d4ab240776182ed31c56a (diff) | |
download | systemd-28a06f5abe7acda656954627d483715478310927.tar.gz systemd-28a06f5abe7acda656954627d483715478310927.tar.bz2 systemd-28a06f5abe7acda656954627d483715478310927.zip |
analyze-security: move assert above first use of the variable (#13238)
-rw-r--r-- | src/analyze/analyze-security.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/analyze/analyze-security.c b/src/analyze/analyze-security.c index 134b2d28c3..dd85f28288 100644 --- a/src/analyze/analyze-security.c +++ b/src/analyze/analyze-security.c @@ -1514,6 +1514,8 @@ static int assess(const struct security_info *info, Table *overview_table, Analy } } + assert(weight_sum > 0); + if (details_table) { size_t row; @@ -1545,7 +1547,6 @@ static int assess(const struct security_info *info, Table *overview_table, Analy return log_error_errno(r, "Failed to output table: %m"); } - assert(weight_sum > 0); exposure = DIV_ROUND_UP(badness_sum * 100U, weight_sum); for (i = 0; i < ELEMENTSOF(badness_table); i++) |