summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-02-16 11:38:47 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-16 13:19:16 -0800
commit8de62c64dc8a9b1e03895714d35e0e781aa0fa1b (patch)
tree8824f0ba831eb030ef3a010978d4ab1fc3f8bf37 /dive.c
parent2d0cf4a87a3876678cc93f71c6438106f85898b9 (diff)
downloadsubsurface-8de62c64dc8a9b1e03895714d35e0e781aa0fa1b.tar.gz
Fix missed "+0.5" rounding - use rint() instead
In commit 23baf20f569f (Use "rint()" instead of rounding manually with "+ 0.5") I had missed this one remaining place where we rounded things by adding "+0.5" and then truncated. Fix that up. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dive.c b/dive.c
index edcb130f4..e4fe8606c 100644
--- a/dive.c
+++ b/dive.c
@@ -513,7 +513,7 @@ static void match_standard_cylinder(cylinder_type_t *type)
default:
return;
}
- len = snprintf(buffer, sizeof(buffer), fmt, (int) (cuft+0.5));
+ len = snprintf(buffer, sizeof(buffer), fmt, rint(cuft));
p = malloc(len+1);
if (!p)
return;