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/option_select.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps/gui/option_select.c') diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index 7b6c489bf3..01259c4136 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c @@ -76,7 +76,7 @@ char *option_get_valuestring(const struct settings_list *setting, if ((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING) { bool val = (bool)temp_var; - strncpy(buffer, str(val? setting->bool_setting->lang_yes : + strlcpy(buffer, str(val? setting->bool_setting->lang_yes : setting->bool_setting->lang_no), buf_len); } #if 0 /* probably dont need this one */ @@ -137,7 +137,7 @@ char *option_get_valuestring(const struct settings_list *setting, const struct choice_setting *info = setting->choice_setting; if (info->talks[(int)temp_var] < LANG_LAST_INDEX_IN_ARRAY) { - strncpy(buffer, str(info->talks[(int)temp_var]), buf_len); + strlcpy(buffer, str(info->talks[(int)temp_var]), buf_len); } else { @@ -149,7 +149,7 @@ char *option_get_valuestring(const struct settings_list *setting, { int value= (int)temp_var; char *val = P2STR(setting->choice_setting->desc[value]); - strncpy(buffer, val, buf_len); + strlcpy(buffer, val, buf_len); } } return buffer; -- cgit v1.2.3