mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:55:07 -05:00
rewrite some assertions for better readability
Some assertions are written as "if (x) assert(0)" to avoid having the text of a long argument compiled in the binary. Rewrite them to use a new BRIEF_ASSERT macro to make the condition easier to read in its non-negated form and make it easier to turn it back to the full-text assert if needed.
This commit is contained in:
3
conf.c
3
conf.c
@@ -2828,8 +2828,7 @@ CNF_GetNtsTrustedCertsPaths(const char ***paths, uint32_t **ids)
|
||||
*paths = ARR_GetElements(nts_trusted_certs_paths);
|
||||
*ids = ARR_GetElements(nts_trusted_certs_ids);
|
||||
|
||||
if (ARR_GetSize(nts_trusted_certs_paths) != ARR_GetSize(nts_trusted_certs_ids))
|
||||
assert(0);
|
||||
BRIEF_ASSERT(ARR_GetSize(nts_trusted_certs_paths) == ARR_GetSize(nts_trusted_certs_ids));
|
||||
|
||||
return ARR_GetSize(nts_trusted_certs_paths);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user