diff options
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c index 923df367c..94ade6243 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -354,6 +354,10 @@ static void temperature(char *buffer, void *_temperature) default: printf("Strange temperature reading %s\n", buffer); } + /* temperatures outside -40C .. +70C should be ignored */ + if (temperature->mkelvin < ZERO_C_IN_MKELVIN - 40000 || + temperature->mkelvin > ZERO_C_IN_MKELVIN + 70000) + temperature->mkelvin = 0; } static void sampletime(char *buffer, void *_time) |