aboutsummaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/dive.c b/core/dive.c
index 351476bb8..36b1376fa 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -1657,9 +1657,10 @@ static void sample_renumber(struct sample *s, int i, const int mapping[])
int j;
for (j = 0; j < MAX_SENSORS; j++) {
- int sensor;
+ int sensor = -1;
- sensor = mapping[s->sensor[j]];
+ if (s->sensor[j] != NO_SENSOR)
+ sensor = mapping[s->sensor[j]];
if (sensor == -1) {
// Remove sensor and gas pressure info
if (i == 0) {