fix: Do not assume size_t == u64

This was causing some compilation trouble on 32bit systems, see #256.

Reported-by: @shsmith
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2017-09-04 16:42:10 -07:00
parent b0c0e28a43
commit 4b59c4f857
2 changed files with 2 additions and 2 deletions

View File

@ -1286,7 +1286,7 @@ int main(int argc, char *argv[])
status_failed(WIRE_ONCHAIN_BAD_COMMAND,
"Can't allocate %"PRIu64" htlcs", num_htlcs);
for (size_t i = 0; i < num_htlcs; i++) {
for (u64 i = 0; i < num_htlcs; i++) {
msg = wire_sync_read(ctx, REQ_FD);
if (!msg || !fromwire_onchain_htlc(msg, NULL, &htlcs[i]))
status_failed(WIRE_ONCHAIN_BAD_COMMAND,

View File

@ -31,7 +31,7 @@ bool wallet_add_utxo(struct wallet *w, struct utxo *utxo,
bool result = db_exec(
__func__, w->db,
"INSERT INTO outputs (prev_out_tx, prev_out_index, value, type, "
"status, keyindex) VALUES ('%s', %d, %zu, %d, %d, %d);",
"status, keyindex) VALUES ('%s', %d, %"PRIu64", %d, %d, %d);",
hextxid, utxo->outnum, utxo->amount, type, output_state_available,
utxo->keyindex);
tal_free(tmpctx);