diff options
author | Nils Wallménius <nils@rockbox.org> | 2009-07-14 13:57:45 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2009-07-14 13:57:45 +0000 |
commit | 3d4701a6e41616cf581a297bab1451cf2db70249 (patch) | |
tree | f845837c96ffbed7d59ddf8308f3b3e7c40cb8c9 /apps/gui/statusbar.c | |
parent | c2900a1bacd5d98b57a0d15ea2add1bc08764057 (diff) | |
download | rockbox-3d4701a6e41616cf581a297bab1451cf2db70249.tar.gz rockbox-3d4701a6e41616cf581a297bab1451cf2db70249.zip |
FS#10080
* Move strncpy() from core to the pluginlib
* Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins
* Drop strncpy() from the codec api as no codec used it
* Bump codec and plugin api versions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/statusbar.c')
-rw-r--r-- | apps/gui/statusbar.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 47dcb4ead1..5e215090f5 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -617,7 +617,7 @@ static void gui_statusbar_time(struct screen * display, struct tm *time) | |||
617 | snprintf(buffer, sizeof(buffer), "%02d:%02d", hour, minute); | 617 | snprintf(buffer, sizeof(buffer), "%02d:%02d", hour, minute); |
618 | } | 618 | } |
619 | else { | 619 | else { |
620 | strncpy(buffer, "--:--", sizeof buffer); | 620 | strlcpy(buffer, "--:--", sizeof(buffer)); |
621 | } | 621 | } |
622 | display->setfont(FONT_SYSFIXED); | 622 | display->setfont(FONT_SYSFIXED); |
623 | display->getstringsize(buffer, &width, &height); | 623 | display->getstringsize(buffer, &width, &height); |
@@ -626,7 +626,6 @@ static void gui_statusbar_time(struct screen * display, struct tm *time) | |||
626 | STATUSBAR_Y_POS, buffer); | 626 | STATUSBAR_Y_POS, buffer); |
627 | } | 627 | } |
628 | display->setfont(FONT_UI); | 628 | display->setfont(FONT_UI); |
629 | |||
630 | } | 629 | } |
631 | #endif | 630 | #endif |
632 | 631 | ||
@@ -758,14 +757,14 @@ static void gui_statusbar_icon_recording_info(struct screen * display) | |||
758 | if (global_settings.rec_source == AUDIO_SRC_SPDIF) | 757 | if (global_settings.rec_source == AUDIO_SRC_SPDIF) |
759 | { | 758 | { |
760 | /* Can't measure S/PDIF sample rate on Archos/Sim yet */ | 759 | /* Can't measure S/PDIF sample rate on Archos/Sim yet */ |
761 | strncpy(buffer, "--", sizeof(buffer)); | 760 | strlcpy(buffer, "--", sizeof(buffer)); |
762 | } | 761 | } |
763 | else | 762 | else |
764 | #endif /* HAVE_SPDIF_IN */ | 763 | #endif /* HAVE_SPDIF_IN */ |
765 | { | 764 | { |
766 | static char const * const freq_strings[12] = | 765 | static char const * const freq_strings[12] = |
767 | { "44", "48", "32", "22", "24", "16" }; | 766 | { "44", "48", "32", "22", "24", "16" }; |
768 | strncpy(buffer, freq_strings[global_settings.rec_frequency], | 767 | strlcpy(buffer, freq_strings[global_settings.rec_frequency], |
769 | sizeof(buffer)); | 768 | sizeof(buffer)); |
770 | } | 769 | } |
771 | 770 | ||