]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Fix up temperature conversion
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Aug 2011 23:58:07 +0000 (16:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Aug 2011 23:58:07 +0000 (16:58 -0700)
Oops. No, the water temperature wasn't really 500 degC.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
parse.c

diff --git a/parse.c b/parse.c
index 52609a636c67e0205f8afe13a0924b1dfcca3381..06149c31782adf412f89a8e6746fa53cc46c2c92 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -90,7 +90,9 @@ static int to_feet(depth_t depth)
 
 static int to_C(temperature_t temp)
 {
-       return (temp.mkelvin + 272150) / 1000;
+       if (!temp.mkelvin)
+               return 0;
+       return (temp.mkelvin - 273150) / 1000;
 }
 
 static int to_PSI(pressure_t pressure)