]> git.earman.xyz Git - sensor-watch.git/commitdiff
bugfix on iterating to previous position
authorDavid Volovskiy <devolov@gmail.com>
Sat, 17 Aug 2024 10:33:14 +0000 (06:33 -0400)
committerDavid Volovskiy <devolov@gmail.com>
Tue, 3 Sep 2024 20:08:12 +0000 (16:08 -0400)
movement/watch_faces/complication/wordle_face.c

index 1d40252c42b57eca44b918f8658bccfeab143b38..98da99cfd7bc56d09128b2e3e16133719b8d1a05 100644 (file)
@@ -98,7 +98,7 @@ static uint8_t get_next_pos(uint8_t curr_pos, WordleLetterResult *word_elements_
 
 static uint8_t get_prev_pos(uint8_t curr_pos, WordleLetterResult *word_elements_result) {
     if (curr_pos == 0) return 0;
-    for (size_t pos = curr_pos-1; pos > 0; pos--) {
+    for (int8_t pos = curr_pos-1; pos >= 0; pos--) {
         if (word_elements_result[pos] != WORDLE_LETTER_CORRECT)
             return pos;
     }