From 8de62c64dc8a9b1e03895714d35e0e781aa0fa1b Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 16 Feb 2014 11:38:47 -0800 Subject: 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 Signed-off-by: Dirk Hohndel --- dive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2