summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-09 05:45:58 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-09 05:45:58 -0800
commit9e66312d6a4e693dc094c3e17881e495f65f7d89 (patch)
tree3ea84b63e1b3484cb2cc66157a06cd277d428f94 /dive.c
parent15112712019817e4e64b5c35b7bb38315125e920 (diff)
downloadsubsurface-9e66312d6a4e693dc094c3e17881e495f65f7d89.tar.gz
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>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dive.c b/dive.c
index 0d7a6bfd9..fb9d1e84e 100644
--- a/dive.c
+++ b/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) {