check return values

This commit is contained in:
Christian Grothoff 2015-05-01 10:06:46 +02:00
parent 66355c18c8
commit ad237521e9
2 changed files with 10 additions and 4 deletions

View File

@ -162,9 +162,15 @@ reservemod_add (struct TALER_Amount denom)
"balance_fraction", "balance_fraction",
"balance_currency", "balance_currency",
&old_denom)); &old_denom));
TALER_amount_add (&new_denom, if (GNUNET_OK !=
&old_denom, TALER_amount_add (&new_denom,
&denom); &old_denom,
&denom))
{
fprintf (stderr,
"Integer overflow when computing new balance!\n");
return GNUNET_SYSERR;
}
TALER_amount_hton (&new_denom_nbo, TALER_amount_hton (&new_denom_nbo,
&new_denom); &new_denom);
result = PQexecParams (db_conn, result = PQexecParams (db_conn,

View File

@ -1041,7 +1041,7 @@ TMH_PARSE_amount_json (struct MHD_Connection *connection,
amount->fraction = (uint32_t) fraction; amount->fraction = (uint32_t) fraction;
GNUNET_assert (strlen (TMH_mint_currency_string) < TALER_CURRENCY_LEN); GNUNET_assert (strlen (TMH_mint_currency_string) < TALER_CURRENCY_LEN);
strcpy (amount->currency, TMH_mint_currency_string); strcpy (amount->currency, TMH_mint_currency_string);
TALER_amount_normalize (amount); (void) TALER_amount_normalize (amount);
return GNUNET_OK; return GNUNET_OK;
} }