More assorted coverity fixes (#41601)

One more round, this time with the help of the claudebot, especially for
spelunking in git blame to find the original commit and writing commit
messages from the list of warnings exported from coverity

Co-developed-by: Claude
[claude@anthropic.com](mailto:claude@anthropic.com)
This commit is contained in:
Luca Boccassi
2026-04-12 21:19:12 +01:00
committed by GitHub
4 changed files with 12 additions and 7 deletions
+2
View File
@@ -690,7 +690,9 @@ static void test_float_match(sd_json_variant *v) {
assert_se(sd_json_variant_is_array(v));
assert_se(sd_json_variant_elements(v) == 11);
assert_se(!iszero_safe(sd_json_variant_real(sd_json_variant_by_index(v, 0))));
assert_se(fabs(1.0 - (DBL_MIN / sd_json_variant_real(sd_json_variant_by_index(v, 0)))) <= delta);
assert_se(!iszero_safe(sd_json_variant_real(sd_json_variant_by_index(v, 1))));
assert_se(fabs(1.0 - (DBL_MAX / sd_json_variant_real(sd_json_variant_by_index(v, 1)))) <= delta);
assert_se(sd_json_variant_is_null(sd_json_variant_by_index(v, 2))); /* nan is not supported by json → null */
assert_se(sd_json_variant_is_null(sd_json_variant_by_index(v, 3))); /* +inf is not supported by json → null */