diff options
-rw-r--r-- | apps/gui/statusbar.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 8edc824e2e..9be2343fef 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -610,6 +610,7 @@ static void gui_statusbar_led(struct screen * display) | |||
610 | static void gui_statusbar_time(struct screen * display, struct tm *time) | 610 | static void gui_statusbar_time(struct screen * display, struct tm *time) |
611 | { | 611 | { |
612 | unsigned char buffer[6]; | 612 | unsigned char buffer[6]; |
613 | const unsigned char *p = buffer; | ||
613 | unsigned int width, height; | 614 | unsigned int width, height; |
614 | int hour, minute; | 615 | int hour, minute; |
615 | if ( valid_time(time) ) { | 616 | if ( valid_time(time) ) { |
@@ -624,13 +625,13 @@ static void gui_statusbar_time(struct screen * display, struct tm *time) | |||
624 | snprintf(buffer, sizeof(buffer), "%02d:%02d", hour, minute); | 625 | snprintf(buffer, sizeof(buffer), "%02d:%02d", hour, minute); |
625 | } | 626 | } |
626 | else { | 627 | else { |
627 | strlcpy(buffer, "--:--", sizeof(buffer)); | 628 | p = "--:--"; |
628 | } | 629 | } |
629 | display->setfont(FONT_SYSFIXED); | 630 | display->setfont(FONT_SYSFIXED); |
630 | display->getstringsize(buffer, &width, &height); | 631 | display->getstringsize(p, &width, &height); |
631 | if (height <= STATUSBAR_HEIGHT) { | 632 | if (height <= STATUSBAR_HEIGHT) { |
632 | display->putsxy(STATUSBAR_TIME_X_END(display->getwidth()) - width, | 633 | display->putsxy(STATUSBAR_TIME_X_END(display->getwidth()) - width, |
633 | STATUSBAR_Y_POS, buffer); | 634 | STATUSBAR_Y_POS, p); |
634 | } | 635 | } |
635 | display->setfont(FONT_UI); | 636 | display->setfont(FONT_UI); |
636 | } | 637 | } |
@@ -736,6 +737,7 @@ static void gui_statusbar_icon_recording_info(struct screen * display) | |||
736 | { | 737 | { |
737 | #if CONFIG_CODEC != SWCODEC | 738 | #if CONFIG_CODEC != SWCODEC |
738 | char buffer[3]; | 739 | char buffer[3]; |
740 | const char *p = buffer; | ||
739 | int width, height; | 741 | int width, height; |
740 | display->setfont(FONT_SYSFIXED); | 742 | display->setfont(FONT_SYSFIXED); |
741 | #endif /* CONFIG_CODEC != SWCODEC */ | 743 | #endif /* CONFIG_CODEC != SWCODEC */ |
@@ -764,21 +766,19 @@ static void gui_statusbar_icon_recording_info(struct screen * display) | |||
764 | if (global_settings.rec_source == AUDIO_SRC_SPDIF) | 766 | if (global_settings.rec_source == AUDIO_SRC_SPDIF) |
765 | { | 767 | { |
766 | /* Can't measure S/PDIF sample rate on Archos/Sim yet */ | 768 | /* Can't measure S/PDIF sample rate on Archos/Sim yet */ |
767 | strlcpy(buffer, "--", sizeof(buffer)); | 769 | p = "--"; |
768 | } | 770 | } |
769 | else | 771 | else |
770 | #endif /* HAVE_SPDIF_IN */ | 772 | #endif /* HAVE_SPDIF_IN */ |
771 | { | 773 | { |
772 | static char const * const freq_strings[12] = | 774 | static const char *freq_strings[] = {"44", "48", "32", "22", "24", "16"}; |
773 | { "44", "48", "32", "22", "24", "16" }; | 775 | p = freq_strings[global_settings.rec_frequency]; |
774 | strlcpy(buffer, freq_strings[global_settings.rec_frequency], | ||
775 | sizeof(buffer)); | ||
776 | } | 776 | } |
777 | 777 | ||
778 | display->getstringsize(buffer, &width, &height); | 778 | display->getstringsize(p, &width, &height); |
779 | 779 | ||
780 | if (height <= STATUSBAR_HEIGHT) | 780 | if (height <= STATUSBAR_HEIGHT) |
781 | display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, buffer); | 781 | display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, p); |
782 | 782 | ||
783 | display->setfont(FONT_UI); | 783 | display->setfont(FONT_UI); |
784 | #endif /* CONFIG_CODEC == SWCODEC */ | 784 | #endif /* CONFIG_CODEC == SWCODEC */ |