From 0436dd3e7ecfc3e2bfa6fba4abf7aef63312944e Mon Sep 17 00:00:00 2001 From: buliabyak Date: Tue, 31 Oct 2006 21:19:40 +0000 Subject: [PATCH] fix off-by-one error: setting tprec to 6 was actually writing 7 digits --- src/svg/svg-length.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg/svg-length.cpp b/src/svg/svg-length.cpp index 63af37665..3b13e3d89 100644 --- a/src/svg/svg-length.cpp +++ b/src/svg/svg-length.cpp @@ -99,7 +99,7 @@ static unsigned sp_svg_number_write_d(gchar *buf, double val, unsigned int tprec } /* Determine the actual number of fractional digits */ - fprec = MAX(fprec, tprec - idigits); + fprec = MAX(fprec, tprec - idigits - 1); /* Round value */ val += 0.5 * pow(10.0, - ((double) fprec)); /* Extract integral and fractional parts */ -- 2.30.2