]> git.earman.xyz Git - sensor-watch.git/commitdiff
movement: TOTP face, pad code with leading zeroes
authorJoey Castillo <joeycastillo@utexas.edu>
Wed, 24 Nov 2021 17:20:32 +0000 (12:20 -0500)
committerJoey Castillo <joeycastillo@utexas.edu>
Wed, 24 Nov 2021 17:20:32 +0000 (12:20 -0500)
movement/watch_faces/complications/totp_face.c

index e58fb47d3d2c3a655d503aab387d81c0824b66fc..4aa1382a6d2d6e59c780b3c89ce5b8e9b7e0d562 100644 (file)
@@ -52,7 +52,7 @@ bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void
                 totp_state->steps = result.quot;
             }
             valid_for = TIMESTEP - result.rem;
-            sprintf(buf, "2f%2d%lu", valid_for, totp_state->current_code);
+            sprintf(buf, "2f%2d%06lu", valid_for, totp_state->current_code);
 
             watch_display_string(buf, 0);
             break;