Skip to content

Commit

Permalink
faces/totp: fix error message not displayed bug
Browse files Browse the repository at this point in the history
Forgot to call watch_display_string on the error message.
Of course the message isn't going to be displayed.

Also, increase the buffer size to 10 characters
and output a space to the last position.
This ensures the segments are cleared.

Tested-by: Matheus Afonso Martins Moreira <[email protected]>
Tested-on-hardware-by: madhogs <[email protected]>
Signed-off-by: Matheus Afonso Martins Moreira <[email protected]>
GitHub-Pull-Request: #385
  • Loading branch information
matheusmoreira committed Aug 26, 2024
1 parent d8b3be6 commit 60e7c4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions movement/watch_faces/complication/totp_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ static bool totp_generate(totp_state_t *totp_state) {
}

static void totp_display_error(totp_state_t *totp_state) {
char buf[9 + 1];
char buf[10 + 1];
totp_t *totp = totp_current(totp_state);

snprintf(buf, sizeof(buf), "%c%c ERROR", totp->labels[0], totp->labels[1]);
snprintf(buf, sizeof(buf), "%c%c ERROR ", totp->labels[0], totp->labels[1]);
watch_display_string(buf, 0);
}

static void totp_display(totp_state_t *totp_state) {
Expand Down

0 comments on commit 60e7c4b

Please sign in to comment.