projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1be8044
)
analyze-security: move assert above first use of the variable (#13238)
author
Jan Synacek
<jsynacek@redhat.com>
Wed, 31 Jul 2019 14:13:35 +0000
(16:13 +0200)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Wed, 31 Jul 2019 14:13:35 +0000
(16:13 +0200)
src/analyze/analyze-security.c
patch
|
blob
|
history
diff --git
a/src/analyze/analyze-security.c
b/src/analyze/analyze-security.c
index 134b2d28c3bf6ab34c50f0faa82c623182e6ab00..dd85f282885c29187a423b8558d912325c8db89f 100644
(file)
--- 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++)