layout: fix last commit

This commit is contained in:
Pavol Rusnak 2018-01-15 18:56:57 +01:00
parent f70772fb58
commit cd763b979b
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 4 additions and 3 deletions

View File

@ -14,7 +14,7 @@ if len(sys.argv) != 2 or sys.argv[1] not in ("count", "array"):
def get_fields(coin):
return [
'"%s"' % coin['coin_name'] if coin['coin_name'] is not None else 'NULL',
'" %s to"' % coin['coin_shortcut'] if coin['coin_shortcut'] is not None else 'NULL',
'" %s"' % coin['coin_shortcut'] if coin['coin_shortcut'] is not None else 'NULL',
'%d' % coin['maxfee_kb'] if coin['maxfee_kb'] is not None else '0',
'"\\x%02x" "%s"' % (len(coin['signed_message_header']), coin['signed_message_header'].replace('\n', '\\n')) if coin['signed_message_header'] is not None else 'NULL',
'true' if coin['address_type'] is not None else 'false',

View File

@ -126,8 +126,9 @@ void layoutHome(void)
void layoutConfirmOutput(const CoinInfo *coin, const TxOutputType *out)
{
char str_out[32];
bn_format_uint64(out->amount, NULL, coin->coin_shortcut, BITCOIN_DIVISIBILITY, 0, false, str_out, sizeof(str_out));
char str_out[32 + 3];
bn_format_uint64(out->amount, NULL, coin->coin_shortcut, BITCOIN_DIVISIBILITY, 0, false, str_out, sizeof(str_out) - 3);
strlcat(str_out, " to", sizeof(str_out));
static char lines[2][28];
const char *addr = out->address;
int addrlen = strlen(addr);