aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-08-31 08:45:43 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-08-31 08:45:43 -0700
commit446e51ccf032c6449c8d38dbac0b2110b4246bc5 (patch)
tree08b8df42fcedb77bdc943a6e6bf8b0d97e8895f5
parent5625b31873ae5a76b76b036be18858327a25d8f0 (diff)
downloadsubsurface-446e51ccf032c6449c8d38dbac0b2110b4246bc5.tar.gz
Fix depth parsing
The "decimal: it's meters, integer: it's feet" logic doesn't work. It's just always meters, because the xml ends up sometimes having whole meters. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--parse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/parse.c b/parse.c
index f90c16ce1..03cede25d 100644
--- a/parse.c
+++ b/parse.c
@@ -222,11 +222,10 @@ static void depth(char *buffer, void *_depth)
union int_or_float val;
switch (integer_or_float(buffer, &val)) {
- /* Integer values are probably in feet */
+ /* All values are probably in meters */
case INTEGER:
- depth->mm = 304.8 * val.i;
- break;
- /* Float? Probably meters.. */
+ val.fp = val.i;
+ /* fallthrough */
case FLOAT:
depth->mm = val.fp * 1000;
break;