diff options
author | Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> | 2024-03-20 11:29:02 -0300 |
---|---|---|
committer | Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> | 2024-03-20 12:54:10 -0300 |
commit | 7e5c34773a4e8a47c2f8e77bd5c7ec58f4a7a84c (patch) | |
tree | c0525e6f2918a53aba1c7ced5a48a88ce7c43aec | |
parent | 3f850d79c8b0b4da5c1b8854f2e6437ca163edc4 (diff) | |
download | Sensor-Watch-7e5c34773a4e8a47c2f8e77bd5c7ec58f4a7a84c.tar.gz Sensor-Watch-7e5c34773a4e8a47c2f8e77bd5c7ec58f4a7a84c.tar.bz2 Sensor-Watch-7e5c34773a4e8a47c2f8e77bd5c7ec58f4a7a84c.zip |
faces/totp: fix error message not displayed bug
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 <matheus.a.m.moreira@gmail.com>
Tested-on-hardware-by: madhogs <59648482+madhogs@users.noreply.github.com>
Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/385
-rw-r--r-- | movement/watch_faces/complication/totp_face.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/movement/watch_faces/complication/totp_face.c b/movement/watch_faces/complication/totp_face.c index 150add00..2938337e 100644 --- a/movement/watch_faces/complication/totp_face.c +++ b/movement/watch_faces/complication/totp_face.c @@ -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) { |