summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--amount.cc10
-rw-r--r--binary.cc1
2 files changed, 4 insertions, 7 deletions
diff --git a/amount.cc b/amount.cc
index e0507c7c..a99f7d73 100644
--- a/amount.cc
+++ b/amount.cc
@@ -906,15 +906,13 @@ void amount_t::write_quantity(std::ostream& out) const
void amount_t::read_quantity(std::istream& in)
{
- assert(! quantity);
-
char byte;
in.read(&byte, sizeof(byte));
- if (byte == 0)
- return;
-
- if (byte == 1) {
+ if (byte == 0) {
+ quantity = NULL;
+ }
+ else if (byte == 1) {
quantity = new(bigints_next++) bigint_t;
quantity->flags |= BIGINT_BULK_ALLOC;
diff --git a/binary.cc b/binary.cc
index 0d71a11b..3d2f8edc 100644
--- a/binary.cc
+++ b/binary.cc
@@ -128,7 +128,6 @@ inline void read_binary_transaction(std::istream& in, transaction_t * xact,
xact->account = accounts[read_binary_number<account_t::ident_t>(in) - 1];
xact->account->add_transaction(xact);
- new ((amount_t *) &xact->amount) amount_t;
read_binary_amount(in, xact->amount);
if (read_binary_number<char>(in) == 1) {