analyze-security: move assert above first use of the variable (#13238)

This commit is contained in:
Jan Synacek 2019-07-31 16:13:35 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 1be8044b5b
commit 28a06f5abe

View file

@ -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++)