aboutsummaryrefslogtreecommitdiffstats
path: root/core/divelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/divelist.c')
-rw-r--r--core/divelist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/divelist.c b/core/divelist.c
index 71a4b9bda..f088195fd 100644
--- a/core/divelist.c
+++ b/core/divelist.c
@@ -100,8 +100,8 @@ int total_weight(const struct dive *dive)
int i, total_grams = 0;
if (dive)
- for (i = 0; i < MAX_WEIGHTSYSTEMS; i++)
- total_grams += dive->weightsystem[i].weight.grams;
+ for (i = 0; i < dive->weightsystems.nr; i++)
+ total_grams += dive->weightsystems.weightsystems[i].weight.grams;
return total_grams;
}