summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-11-23 23:37:42 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-11-23 23:37:42 -0400
commitc9959f2008fa7df1d5487f9a0d02f546a3b3a37b (patch)
treeae7da3497b5ae0fc2a1f6e5a80f2042ae892f841
parent1921f011898b5e2e689d3ea2e0d1baf4fc8d92e4 (diff)
downloadfork-ledger-c9959f2008fa7df1d5487f9a0d02f546a3b3a37b.tar.gz
fork-ledger-c9959f2008fa7df1d5487f9a0d02f546a3b3a37b.tar.bz2
fork-ledger-c9959f2008fa7df1d5487f9a0d02f546a3b3a37b.zip
Added a missing call to _dup() in amount_t::in_place_round. Thanks to unit
testing!
-rw-r--r--src/amount.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/amount.cc b/src/amount.cc
index 37690c76..5958962d 100644
--- a/src/amount.cc
+++ b/src/amount.cc
@@ -606,6 +606,7 @@ amount_t& amount_t::in_place_round(precision_t prec)
DEBUG("amount.round", "Rounding " << *this << " to precision " << prec);
+ _dup();
mpz_round(MPZ(quantity), MPZ(quantity), quantity->prec, prec);
quantity->prec = prec;