diff options
| author | Nils Wallménius <nils@rockbox.org> | 2007-07-02 19:52:19 +0000 |
|---|---|---|
| committer | Nils Wallménius <nils@rockbox.org> | 2007-07-02 19:52:19 +0000 |
| commit | ede373108adbd3bfb54f93c3c9841179fd581f21 (patch) | |
| tree | f0ef50c5cd312eaeaf4077a468126d6ea006b795 | |
| parent | 7d5deaa5a032f0f5f1617b8d73b3c412868bcf88 (diff) | |
| download | rockbox-ede373108adbd3bfb54f93c3c9841179fd581f21.zip rockbox-ede373108adbd3bfb54f93c3c9841179fd581f21.tar.gz rockbox-ede373108adbd3bfb54f93c3c9841179fd581f21.tar.bz2 rockbox-ede373108adbd3bfb54f93c3c9841179fd581f21.tar.xz | |
Remove useless #ifdef, specify maximum field width for strings in the snprintf() call
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13766 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/screens.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/screens.c b/apps/screens.c index a285300..79bfa42 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -890,11 +890,9 @@ bool set_time_screen(const char* title, struct tm *tm) ptr[4] = buffer + 15 + DAYNAME_LEN; /* monthname */ ptr[5] = buffer + 16 + DAYNAME_LEN + MONTHNAME_LEN; /* day of month */ -#ifdef HAVE_LCD_BITMAP if(global_settings.statusbar) statusbar_height = STATUSBAR_HEIGHT; else -#endif statusbar_height = 0; while ( !done ) { @@ -919,11 +917,12 @@ bool set_time_screen(const char* title, struct tm *tm) (realyear - 1) / 100 + (realyear - 1) / 400 + 7 - 1) % 7; /* copy all the stuff we want from the tm struct to buffer */ - snprintf(buffer, sizeof(buffer), "%02d " "%02d " "%02d " "%s " "%04d " "%s " "%02d", + snprintf(buffer, sizeof(buffer), + "%02d " "%02d " "%02d " "%.3s " "%04d " "%.3s " "%02d", tm->tm_hour, tm->tm_min, tm->tm_sec, str(dayname[tm->tm_wday]), tm->tm_year+1900, str(monthname[tm->tm_mon]), tm->tm_mday); - + /* recalculate the positions and offsets */ lcd_getstringsize(title, &width, &prev_line_height); lcd_getstringsize(buffer, &width, &line_height); |