diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2009-10-30 14:34:13 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2009-10-30 14:34:13 +0000 |
commit | a404e9ae24bb99e127e7f43a545e717c14e49ff5 (patch) | |
tree | 6cbf7aa4e78bd04d6d96f7ba780383f41f61f41e | |
parent | 08c5a66f8ac08b5d2d25d8804e6c8603577664f7 (diff) | |
download | rockbox-a404e9ae24bb99e127e7f43a545e717c14e49ff5.tar.gz rockbox-a404e9ae24bb99e127e7f43a545e717c14e49ff5.zip |
Fix time display in time menu when time is not valid.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23421 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/menus/time_menu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c index cb31c33fc9..b1ea33f858 100644 --- a/apps/menus/time_menu.c +++ b/apps/menus/time_menu.c | |||
@@ -175,14 +175,14 @@ static void draw_timedate(struct viewport *vp, struct screen *display) | |||
175 | 175 | ||
176 | if (valid_time(tm)) | 176 | if (valid_time(tm)) |
177 | { | 177 | { |
178 | snprintf(time, 16, "%02d:%02d:%02d%s", | 178 | snprintf(time, sizeof(time), "%02d:%02d:%02d%s", |
179 | global_settings.timeformat == 0 ? tm->tm_hour : | 179 | global_settings.timeformat == 0 ? tm->tm_hour : |
180 | ((tm->tm_hour + 11) % 12) + 1, | 180 | ((tm->tm_hour + 11) % 12) + 1, |
181 | tm->tm_min, | 181 | tm->tm_min, |
182 | tm->tm_sec, | 182 | tm->tm_sec, |
183 | global_settings.timeformat == 0 ? "" : | 183 | global_settings.timeformat == 0 ? "" : |
184 | tm->tm_hour>11 ? " P" : " A"); | 184 | tm->tm_hour>11 ? " P" : " A"); |
185 | snprintf(date, 16, "%s %d %d", | 185 | snprintf(date, sizeof(date), "%s %d %d", |
186 | str(LANG_MONTH_JANUARY + tm->tm_mon), | 186 | str(LANG_MONTH_JANUARY + tm->tm_mon), |
187 | tm->tm_mday, | 187 | tm->tm_mday, |
188 | tm->tm_year+1900); | 188 | tm->tm_year+1900); |
@@ -193,8 +193,8 @@ static void draw_timedate(struct viewport *vp, struct screen *display) | |||
193 | d = str(LANG_UNKNOWN); | 193 | d = str(LANG_UNKNOWN); |
194 | } | 194 | } |
195 | 195 | ||
196 | display->puts_scroll(0, line++, time); | 196 | display->puts_scroll(0, line++, t); |
197 | display->puts_scroll(0, line, date); | 197 | display->puts_scroll(0, line, d); |
198 | 198 | ||
199 | display->update_viewport(); | 199 | display->update_viewport(); |
200 | display->set_viewport(NULL); | 200 | display->set_viewport(NULL); |