Fix text buffer overflow in sunrise_sunset_face (#22)

This commit is contained in:
PrimmR
2025-07-06 16:31:45 +01:00
committed by GitHub
parent 976fd3248b
commit b5a457cd19
2 changed files with 3 additions and 3 deletions

View File

@@ -152,7 +152,7 @@ static void _sunrise_sunset_face_update(sunrise_sunset_state_t *state) {
watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, "RIS", "rI");
sprintf(buf, "%2d", scratch_time.unit.day);
watch_display_text(WATCH_POSITION_TOP_RIGHT, buf);
sprintf(buf, "%2d%02d%s", scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
sprintf(buf, "%2d%02d%2s", scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
watch_display_text(WATCH_POSITION_BOTTOM, buf);
return;
} else {
@@ -191,7 +191,7 @@ static void _sunrise_sunset_face_update(sunrise_sunset_state_t *state) {
watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, "SET", "SE");
sprintf(buf, "%2d", scratch_time.unit.day);
watch_display_text(WATCH_POSITION_TOP_RIGHT, buf);
sprintf(buf, "%2d%02d%s", scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
sprintf(buf, "%2d%02d%2s", scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
watch_display_text(WATCH_POSITION_BOTTOM, buf);
return;
} else {