mirror of
https://github.com/joeycastillo/second-movement.git
synced 2025-10-29 19:47:40 +00:00
Fix text buffer overflow in sunrise_sunset_face (#22)
This commit is contained in:
parent
976fd3248b
commit
b5a457cd19
@ -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 {
|
||||
|
||||
@ -72,7 +72,7 @@ void sunrise_sunset_face_resign(void *context);
|
||||
})
|
||||
|
||||
typedef struct {
|
||||
char name[2];
|
||||
char name[3];
|
||||
int16_t latitude;
|
||||
int16_t longitude;
|
||||
} long_lat_presets_t;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user