mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Initialize variables in helper functions
In commit 904aa0be0d0e ("Do more dive fixup for each dive computer") two new helper functions were introduced that sadly both incremented variables without initializing them, first. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1511271201
commit
9e66312d6a
1 changed files with 2 additions and 2 deletions
4
dive.c
4
dive.c
|
@ -427,7 +427,7 @@ static struct event *find_previous_event(struct divecomputer *dc, struct event *
|
|||
static void fixup_surface_pressure(struct dive *dive)
|
||||
{
|
||||
struct divecomputer *dc;
|
||||
int sum, nr;
|
||||
int sum = 0, nr = 0;
|
||||
|
||||
for_each_dc(dive, dc) {
|
||||
if (dc->surface_pressure.mbar) {
|
||||
|
@ -442,7 +442,7 @@ static void fixup_surface_pressure(struct dive *dive)
|
|||
static void fixup_water_salinity(struct dive *dive)
|
||||
{
|
||||
struct divecomputer *dc;
|
||||
int sum, nr;
|
||||
int sum = 0, nr = 0;
|
||||
|
||||
for_each_dc(dive, dc) {
|
||||
if (dc->salinity) {
|
||||
|
|
Loading…
Reference in a new issue