check return value from TALER_amount_get_zero
This commit is contained in:
parent
2f715c27f8
commit
dbab0c6587
@ -42,7 +42,6 @@ TALER_EXCHANGE_verify_coin_history (const char *currency,
|
|||||||
struct TALER_Amount *total)
|
struct TALER_Amount *total)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
size_t off;
|
|
||||||
int add;
|
int add;
|
||||||
struct TALER_Amount rtotal;
|
struct TALER_Amount rtotal;
|
||||||
|
|
||||||
@ -57,11 +56,13 @@ TALER_EXCHANGE_verify_coin_history (const char *currency,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
TALER_amount_get_zero (currency,
|
GNUNET_assert (GNUNET_OK ==
|
||||||
total);
|
TALER_amount_get_zero (currency,
|
||||||
TALER_amount_get_zero (currency,
|
total));
|
||||||
&rtotal);
|
GNUNET_assert (GNUNET_OK ==
|
||||||
for (off=0;off<len;off++)
|
TALER_amount_get_zero (currency,
|
||||||
|
&rtotal));
|
||||||
|
for (size_t off=0;off<len;off++)
|
||||||
{
|
{
|
||||||
json_t *transaction;
|
json_t *transaction;
|
||||||
struct TALER_Amount amount;
|
struct TALER_Amount amount;
|
||||||
|
@ -104,10 +104,12 @@ parse_reserve_history (struct TALER_EXCHANGE_Handle *exchange,
|
|||||||
struct TALER_Amount total_out;
|
struct TALER_Amount total_out;
|
||||||
size_t off;
|
size_t off;
|
||||||
|
|
||||||
TALER_amount_get_zero (currency,
|
GNUNET_assert (GNUNET_OK ==
|
||||||
&total_in);
|
TALER_amount_get_zero (currency,
|
||||||
TALER_amount_get_zero (currency,
|
&total_in));
|
||||||
&total_out);
|
GNUNET_assert (GNUNET_OK ==
|
||||||
|
TALER_amount_get_zero (currency,
|
||||||
|
&total_out));
|
||||||
uuid_off = 0;
|
uuid_off = 0;
|
||||||
for (off=0;off<history_length;off++)
|
for (off=0;off<history_length;off++)
|
||||||
{
|
{
|
||||||
|
@ -1006,8 +1006,9 @@ expired_reserve_cb (void *cls,
|
|||||||
/* Closing fee higher than remaining balance, close
|
/* Closing fee higher than remaining balance, close
|
||||||
without wire transfer. */
|
without wire transfer. */
|
||||||
closing_fee = left;
|
closing_fee = left;
|
||||||
TALER_amount_get_zero (left->currency,
|
GNUNET_assert (GNUNET_OK ==
|
||||||
&amount_without_fee);
|
TALER_amount_get_zero (left->currency,
|
||||||
|
&amount_without_fee));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NOTE: sizeof (*reserve_pub) == sizeof (wtid) right now, but to
|
/* NOTE: sizeof (*reserve_pub) == sizeof (wtid) right now, but to
|
||||||
|
@ -132,8 +132,9 @@ TEH_DB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionLis
|
|||||||
struct TALER_EXCHANGEDB_TransactionList *pos;
|
struct TALER_EXCHANGEDB_TransactionList *pos;
|
||||||
struct TALER_Amount refunded;
|
struct TALER_Amount refunded;
|
||||||
|
|
||||||
TALER_amount_get_zero (spent.currency,
|
GNUNET_assert (GNUNET_OK ==
|
||||||
&refunded);
|
TALER_amount_get_zero (spent.currency,
|
||||||
|
&refunded));
|
||||||
for (pos = tl; NULL != pos; pos = pos->next)
|
for (pos = tl; NULL != pos; pos = pos->next)
|
||||||
{
|
{
|
||||||
switch (pos->type)
|
switch (pos->type)
|
||||||
|
@ -214,8 +214,9 @@ payback_transaction (void *cls,
|
|||||||
}
|
}
|
||||||
return qs;
|
return qs;
|
||||||
}
|
}
|
||||||
TALER_amount_get_zero (pc->value.currency,
|
GNUNET_assert (GNUNET_OK ==
|
||||||
&spent);
|
TALER_amount_get_zero (pc->value.currency,
|
||||||
|
&spent));
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TEH_DB_calculate_transaction_list_totals (tl,
|
TEH_DB_calculate_transaction_list_totals (tl,
|
||||||
&spent,
|
&spent,
|
||||||
|
@ -309,8 +309,9 @@ withdraw_transaction (void *cls,
|
|||||||
if (0 == (res & 2))
|
if (0 == (res & 2))
|
||||||
{
|
{
|
||||||
/* did not encounter any withdraw operations, set to zero */
|
/* did not encounter any withdraw operations, set to zero */
|
||||||
TALER_amount_get_zero (deposit_total.currency,
|
GNUNET_assert (GNUNET_OK ==
|
||||||
&withdraw_total);
|
TALER_amount_get_zero (deposit_total.currency,
|
||||||
|
&withdraw_total));
|
||||||
}
|
}
|
||||||
/* All reserve balances should be non-negative */
|
/* All reserve balances should be non-negative */
|
||||||
if (GNUNET_SYSERR ==
|
if (GNUNET_SYSERR ==
|
||||||
|
@ -879,8 +879,9 @@ TEH_RESPONSE_compile_reserve_history (const struct TALER_EXCHANGEDB_ReserveHisto
|
|||||||
if (0 == (2 & ret))
|
if (0 == (2 & ret))
|
||||||
{
|
{
|
||||||
/* did not encounter any withdraw operations, set to zero */
|
/* did not encounter any withdraw operations, set to zero */
|
||||||
TALER_amount_get_zero (deposit_total.currency,
|
GNUNET_assert (GNUNET_OK ==
|
||||||
&withdraw_total);
|
TALER_amount_get_zero (deposit_total.currency,
|
||||||
|
&withdraw_total));
|
||||||
}
|
}
|
||||||
if (GNUNET_SYSERR ==
|
if (GNUNET_SYSERR ==
|
||||||
TALER_amount_subtract (balance,
|
TALER_amount_subtract (balance,
|
||||||
|
Loading…
Reference in New Issue
Block a user