1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-22 05:10:56 +00:00

layout: don't split short addresses in layoutAddress

This commit is contained in:
Pavol Rusnak 2018-10-23 17:48:45 +02:00
parent e650ac47e2
commit 781d4c24c1
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -546,13 +546,17 @@ void layoutAddress(const char *address, const char *desc, bool qrcode, bool igno
} }
} }
} else { } else {
uint32_t rowlen = (addrlen - 1) / (addrlen <= 42 ? 2 : addrlen <= 63 ? 3 : 4) + 1;
const char **str = split_message((const uint8_t *)address, addrlen, rowlen);
if (desc) { if (desc) {
oledDrawString(0, 0 * 9, desc, FONT_STANDARD); oledDrawString(0, 0 * 9, desc, FONT_STANDARD);
} }
for (int i = 0; i < 4; i++) { if (addrlen > 10) { // don't split short addresses
oledDrawString(0, (i + 1) * 9 + 4, str[i], FONT_FIXED); uint32_t rowlen = (addrlen - 1) / (addrlen <= 42 ? 2 : addrlen <= 63 ? 3 : 4) + 1;
const char **str = split_message((const uint8_t *)address, addrlen, rowlen);
for (int i = 0; i < 4; i++) {
oledDrawString(0, (i + 1) * 9 + 4, str[i], FONT_FIXED);
}
} else {
oledDrawString(0, (0 + 1) * 9 + 4, address, FONT_FIXED);
} }
oledDrawString(0, 42, address_n_str(address_n, address_n_count, address_is_account), FONT_STANDARD); oledDrawString(0, 42, address_n_str(address_n, address_n_count, address_is_account), FONT_STANDARD);
} }