diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 11:06:46 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-09-15 16:28:07 +0200 |
commit | 41bbae31f53df0b5d946a11f5fe8cc4b8e0f7a41 (patch) | |
tree | e33c76bab3ddbe72b83137621982084311c09ec6 /core/save-xml.c | |
parent | a8ce78bf775d9debef05ea697da240e85a7c8e80 (diff) | |
download | subsurface-41bbae31f53df0b5d946a11f5fe8cc4b8e0f7a41.tar.gz |
xml: save the right sensor pressure when we have multiple sensor readings
The XML saving code got the multi-sensor case completely wrong, because
it still had one place where it would always save the first pressure,
rather than the pressure from the right sensor.
This was hidden by the fact that old data would be saved using the
legacy model that only ever used the first sensor slot. Only if you
actually had multiple sensor slots used would the bug trigger.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/save-xml.c')
-rw-r--r-- | core/save-xml.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/save-xml.c b/core/save-xml.c index df6b99eb1..d3b9e6c8d 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -220,7 +220,7 @@ static void save_sample(struct membuffer *b, struct sample *sample, struct sampl put_pressure(b, p, " o2pressure='", " bar'"); continue; } - put_pressure(b, sample->pressure[0], " pressure='", " bar'"); + put_pressure(b, p, " pressure='", " bar'"); if (sensor != old->sensor[0]) { put_format(b, " sensor='%d'", sensor); old->sensor[0] = sensor; |