mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Core: cast before multiplication to avoid potential overflow
Found via LGTM.com Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
47f92b92ac
commit
2d26300402
1 changed files with 1 additions and 1 deletions
|
@ -292,7 +292,7 @@ double tissue_tolerance_calc(struct deco_state *ds, const struct dive *dive, dou
|
|||
if (plot_depth) {
|
||||
++sum1;
|
||||
sumx += plot_depth;
|
||||
sumxx += plot_depth * plot_depth;
|
||||
sumxx += (long)plot_depth * plot_depth;
|
||||
double n2_gradient, he_gradient, total_gradient;
|
||||
n2_gradient = update_gradient(ds, depth_to_bar(plot_depth, &displayed_dive), ds->bottom_n2_gradient[ds->ci_pointing_to_guiding_tissue]);
|
||||
he_gradient = update_gradient(ds, depth_to_bar(plot_depth, &displayed_dive), ds->bottom_he_gradient[ds->ci_pointing_to_guiding_tissue]);
|
||||
|
|
Loading…
Add table
Reference in a new issue