Fix missed "+0.5" rounding - use rint() instead

In commit 23baf20f56 (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>
This commit is contained in:
Linus Torvalds 2014-02-16 11:38:47 -08:00 committed by Dirk Hohndel
parent 2d0cf4a87a
commit 8de62c64dc

2
dive.c
View file

@ -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;