From a481cdc13d7bde8b12ef26b01b8c6722373ce0da Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 13 Sep 2021 20:57:56 +0200 Subject: core: don't write pressure samples with "no sensor" This has led to broken XML files, don't do it. Signed-off-by: Berthold Stoeger --- core/save-git.c | 3 +++ core/save-xml.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/core/save-git.c b/core/save-git.c index 6bd237a8b..fc6567950 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -258,6 +258,9 @@ static void save_sample(struct membuffer *b, struct sample *sample, struct sampl pressure_t p = sample->pressure[idx]; int sensor = sample->sensor[idx]; + if (sensor == NO_SENSOR) + continue; + if (!p.mbar) continue; diff --git a/core/save-xml.c b/core/save-xml.c index a82fcef4b..f35831461 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -256,6 +256,9 @@ static void save_sample(struct membuffer *b, struct sample *sample, struct sampl pressure_t p = sample->pressure[idx]; int sensor = sample->sensor[idx]; + if (sensor == NO_SENSOR) + continue; + if (!p.mbar) continue; -- cgit v1.2.3-70-g09d2