From: buliabyak Date: Tue, 31 Oct 2006 21:19:40 +0000 (+0000) Subject: fix off-by-one error: setting tprec to 6 was actually writing 7 digits X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0436dd3e7ecfc3e2bfa6fba4abf7aef63312944e;p=inkscape.git fix off-by-one error: setting tprec to 6 was actually writing 7 digits --- 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 */