From cd763b979b0001d4e23fffaf68fa59cfe483a6ba Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 15 Jan 2018 18:56:57 +0100 Subject: [PATCH] layout: fix last commit --- firmware/coins-gen.py | 2 +- firmware/layout2.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/coins-gen.py b/firmware/coins-gen.py index dfd1f8b..a184ccd 100755 --- a/firmware/coins-gen.py +++ b/firmware/coins-gen.py @@ -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', diff --git a/firmware/layout2.c b/firmware/layout2.c index 2d2952f..7852460 100644 --- a/firmware/layout2.c +++ b/firmware/layout2.c @@ -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);