Skip to content

mnemonic: fix %zu format specifier in restore-flow titles - #350

Open
oroderico wants to merge 1 commit into
Blockstream:masterfrom
oroderico:fix-mnemonic-restore-title-format
Open

oroderico wants to merge 1 commit into
Blockstream:masterfrom
oroderico:fix-mnemonic-restore-title-format

Conversation

@oroderico

Copy link
Copy Markdown
Contributor

snprintf() titles in the mnemonic restore flow (select/confirm/insert
word, and the word-number restore method from #312) used %zu for
size_t args. On ESP32-S3 (tested on Waveshare S3 Touch LCD2) this
renders literally as "zu" instead of the number, e.g. "Word zu/zu".

Cast to unsigned int and use %u instead.

Tested on device: titles now render correctly in both the normal
typed restore and the word-number restore flow.

snprintf() titles for the mnemonic restore flow (word selection,
confirmation, insertion, and word-number restore) used %zu for
size_t arguments. On at least ESP32-S3 boards this renders the
raw "zu" characters instead of the value (e.g. "Word zu/zu"),
observed on a Waveshare S3 Touch LCD2. Cast to unsigned int and
use %u instead, which is unambiguous on this 32-bit target.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant