summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2007-07-02 19:52:19 +0000
committerNils Wallménius <nils@rockbox.org>2007-07-02 19:52:19 +0000
commitede373108adbd3bfb54f93c3c9841179fd581f21 (patch)
treef0ef50c5cd312eaeaf4077a468126d6ea006b795 /apps
parent7d5deaa5a032f0f5f1617b8d73b3c412868bcf88 (diff)
downloadrockbox-ede373108adbd3bfb54f93c3c9841179fd581f21.tar.gz
rockbox-ede373108adbd3bfb54f93c3c9841179fd581f21.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/screens.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/screens.c b/apps/screens.c
index a285300107..79bfa423a3 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -890,11 +890,9 @@ bool set_time_screen(const char* title, struct tm *tm)
890 ptr[4] = buffer + 15 + DAYNAME_LEN; /* monthname */ 890 ptr[4] = buffer + 15 + DAYNAME_LEN; /* monthname */
891 ptr[5] = buffer + 16 + DAYNAME_LEN + MONTHNAME_LEN; /* day of month */ 891 ptr[5] = buffer + 16 + DAYNAME_LEN + MONTHNAME_LEN; /* day of month */
892 892
893#ifdef HAVE_LCD_BITMAP
894 if(global_settings.statusbar) 893 if(global_settings.statusbar)
895 statusbar_height = STATUSBAR_HEIGHT; 894 statusbar_height = STATUSBAR_HEIGHT;
896 else 895 else
897#endif
898 statusbar_height = 0; 896 statusbar_height = 0;
899 897
900 while ( !done ) { 898 while ( !done ) {
@@ -919,11 +917,12 @@ bool set_time_screen(const char* title, struct tm *tm)
919 (realyear - 1) / 100 + (realyear - 1) / 400 + 7 - 1) % 7; 917 (realyear - 1) / 100 + (realyear - 1) / 400 + 7 - 1) % 7;
920 918
921 /* copy all the stuff we want from the tm struct to buffer */ 919 /* copy all the stuff we want from the tm struct to buffer */
922 snprintf(buffer, sizeof(buffer), "%02d " "%02d " "%02d " "%s " "%04d " "%s " "%02d", 920 snprintf(buffer, sizeof(buffer),
921 "%02d " "%02d " "%02d " "%.3s " "%04d " "%.3s " "%02d",
923 tm->tm_hour, tm->tm_min, tm->tm_sec, 922 tm->tm_hour, tm->tm_min, tm->tm_sec,
924 str(dayname[tm->tm_wday]), tm->tm_year+1900, 923 str(dayname[tm->tm_wday]), tm->tm_year+1900,
925 str(monthname[tm->tm_mon]), tm->tm_mday); 924 str(monthname[tm->tm_mon]), tm->tm_mday);
926 925
927 /* recalculate the positions and offsets */ 926 /* recalculate the positions and offsets */
928 lcd_getstringsize(title, &width, &prev_line_height); 927 lcd_getstringsize(title, &width, &prev_line_height);
929 lcd_getstringsize(buffer, &width, &line_height); 928 lcd_getstringsize(buffer, &width, &line_height);