From 3d4701a6e41616cf581a297bab1451cf2db70249 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Tue, 14 Jul 2009 13:57:45 +0000 Subject: 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 --- apps/gui/statusbar.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'apps/gui/statusbar.c') 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) snprintf(buffer, sizeof(buffer), "%02d:%02d", hour, minute); } else { - strncpy(buffer, "--:--", sizeof buffer); + strlcpy(buffer, "--:--", sizeof(buffer)); } display->setfont(FONT_SYSFIXED); display->getstringsize(buffer, &width, &height); @@ -626,7 +626,6 @@ static void gui_statusbar_time(struct screen * display, struct tm *time) STATUSBAR_Y_POS, buffer); } display->setfont(FONT_UI); - } #endif @@ -758,14 +757,14 @@ static void gui_statusbar_icon_recording_info(struct screen * display) if (global_settings.rec_source == AUDIO_SRC_SPDIF) { /* Can't measure S/PDIF sample rate on Archos/Sim yet */ - strncpy(buffer, "--", sizeof(buffer)); + strlcpy(buffer, "--", sizeof(buffer)); } else #endif /* HAVE_SPDIF_IN */ { static char const * const freq_strings[12] = { "44", "48", "32", "22", "24", "16" }; - strncpy(buffer, freq_strings[global_settings.rec_frequency], + strlcpy(buffer, freq_strings[global_settings.rec_frequency], sizeof(buffer)); } -- cgit v1.2.3