summaryrefslogtreecommitdiff
path: root/apps/gui/option_select.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2009-07-14 13:57:45 +0000
committerNils Wallménius <nils@rockbox.org>2009-07-14 13:57:45 +0000
commit3d4701a6e41616cf581a297bab1451cf2db70249 (patch)
treef845837c96ffbed7d59ddf8308f3b3e7c40cb8c9 /apps/gui/option_select.c
parentc2900a1bacd5d98b57a0d15ea2add1bc08764057 (diff)
downloadrockbox-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/option_select.c')
-rw-r--r--apps/gui/option_select.c6
1 files changed, 3 insertions, 3 deletions
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,
76 if ((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING) 76 if ((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING)
77 { 77 {
78 bool val = (bool)temp_var; 78 bool val = (bool)temp_var;
79 strncpy(buffer, str(val? setting->bool_setting->lang_yes : 79 strlcpy(buffer, str(val? setting->bool_setting->lang_yes :
80 setting->bool_setting->lang_no), buf_len); 80 setting->bool_setting->lang_no), buf_len);
81 } 81 }
82#if 0 /* probably dont need this one */ 82#if 0 /* probably dont need this one */
@@ -137,7 +137,7 @@ char *option_get_valuestring(const struct settings_list *setting,
137 const struct choice_setting *info = setting->choice_setting; 137 const struct choice_setting *info = setting->choice_setting;
138 if (info->talks[(int)temp_var] < LANG_LAST_INDEX_IN_ARRAY) 138 if (info->talks[(int)temp_var] < LANG_LAST_INDEX_IN_ARRAY)
139 { 139 {
140 strncpy(buffer, str(info->talks[(int)temp_var]), buf_len); 140 strlcpy(buffer, str(info->talks[(int)temp_var]), buf_len);
141 } 141 }
142 else 142 else
143 { 143 {
@@ -149,7 +149,7 @@ char *option_get_valuestring(const struct settings_list *setting,
149 { 149 {
150 int value= (int)temp_var; 150 int value= (int)temp_var;
151 char *val = P2STR(setting->choice_setting->desc[value]); 151 char *val = P2STR(setting->choice_setting->desc[value]);
152 strncpy(buffer, val, buf_len); 152 strlcpy(buffer, val, buf_len);
153 } 153 }
154 } 154 }
155 return buffer; 155 return buffer;