Skip to content

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

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

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

Conversation

@oroderico

@oroderico oroderico commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The mnemonic restore flow (word selection, confirmation, insertion, and the "restore by word number" method from Add BIP39 word-number mnemonic entry #312) used %zu for size_t arguments in on-screen title snprintf() calls.
  • 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 while testing the word-number restore flow.
  • Cast the arguments to unsigned int and use %u instead, which is unambiguous on this 32-bit target regardless of libc/format-string quirks.

Test plan

  • Built and flashed on a Waveshare S3 Touch LCD2, confirmed titles now render correctly (Word 1/24, Select word N, Insert word N, Confirm word N) in both the normal typed restore and the word-number restore flow.
  • Would appreciate confirmation this was never visible on other (ESP32 classic) boards, to help narrow down the root cause.

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.
@oroderico oroderico closed this Sep 18, 2026
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