summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-08-30 16:58:07 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-08-30 16:58:07 -0700
commit716a680920cdd27129c36ea284e44920d0f2d79d (patch)
tree250996435a1e6a601ec80dbca2487190fcd6d1c9
parentf46e9f571e92156cd764d6711cac671c053260a1 (diff)
downloadsubsurface-716a680920cdd27129c36ea284e44920d0f2d79d.tar.gz
Fix up temperature conversion
Oops. No, the water temperature wasn't really 500 degC. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 52609a636..06149c317 100644
--- 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)