extract/ExtBasic.c: Multiplication result converted to larger type

Fix code scanning alert no. 52: Multiplication result converted to larger type (#49)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
Darryl Miles 2024-09-30 07:13:59 +01:00 committed by Tim Edwards
parent 00086817a4
commit 1a351efd56
1 changed files with 1 additions and 1 deletions

View File

@ -612,7 +612,7 @@ extSetResist(reg)
reg->nreg_pa[n].pa_perim = perim = extResistPerim[n]; reg->nreg_pa[n].pa_perim = perim = extResistPerim[n];
if (area > 0 && perim > 0) if (area > 0 && perim > 0)
{ {
v = (double) (perim*perim - 16*area); v = (double) ((dlong)perim * perim - 16 * area);
/* Approximate by one square if v < 0 */ /* Approximate by one square if v < 0 */
if (v < 0) s = 0; else s = sqrt(v); if (v < 0) s = 0; else s = sqrt(v);