Correctly find min o2 in get_dive_gas

When the import from a dive computer gives you 100% as the first gas,
the get_dive_gas never finds which gas had the lowest o2 percent.

This fixes the logic to find the lowest o2 percent in any dive cylinder
list.

Signed-off-by: Anton Lundin <glance@ac2.se>
This commit is contained in:
Anton Lundin 2023-10-11 22:15:43 +02:00 committed by Michael Keller
parent 8f4b6cfcb9
commit 725b70e64c

View file

@ -47,6 +47,8 @@ void get_dive_gas(const struct dive *dive, int *o2_p, int *he_p, int *o2max_p)
continue;
if (o2 > maxo2)
maxo2 = o2;
if (o2 < mino2)
mino2 = o2;
if (he > maxhe)
goto newmax;
if (he < maxhe)