From 43d2f805c164656d56bbe1479f4361cda2d2954b Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Fri, 25 Feb 2022 15:20:18 +0100 Subject: [PATCH] src/stats.c: fix double assignment to stats->min Fixes defect reported by coverity: | CID 1475713 (#1 of 1): Unused value (UNUSED_VALUE) | assigned_value: Assigning value 1.79769e+308 to stats->min here, but that stored value is overwritten before it can be used. This also fixes 'min' calculation as 'min' was already set to the smalles possible value and thus could not be decreased. Signed-off-by: Enrico Joerns --- src/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stats.c b/src/stats.c index 3e550bee4..b20508872 100644 --- a/src/stats.c +++ b/src/stats.c @@ -7,7 +7,7 @@ void r_stats_init(struct RaucStats *stats) memset(stats, 0, sizeof(*stats)); stats->min = G_MAXDOUBLE; - stats->min = G_MINDOUBLE; + stats->max = G_MINDOUBLE; } void r_stats_add(struct RaucStats *stats, gdouble value)