From d6cc790d481b3ad3856fc6564af8526d1d01d36c Mon Sep 17 00:00:00 2001 From: Darryl Miles Date: Mon, 30 Sep 2024 07:12:45 +0100 Subject: [PATCH] extflat/EFvisit.c: Multiplication result converted to larger type Fix code scanning alert no. 50: Multiplication result converted to larger type (#51) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- extflat/EFvisit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extflat/EFvisit.c b/extflat/EFvisit.c index e28b7135..285677da 100644 --- a/extflat/EFvisit.c +++ b/extflat/EFvisit.c @@ -789,7 +789,7 @@ EFNodeResist(node) if (v < 0.0) s = 0.0; else s = sqrt(v); fperim = (float) perim; - dresist = (fperim + s)/(fperim - s) * efResists[n]; + dresist = ((double)fperim + (double)s)/((double)fperim - (double)s) * efResists[n]; if (dresist + (double) resist > (double) INT_MAX) resist = INT_MAX; else