summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Jarosch <tomj@simonv.com>2014-12-22 21:04:10 +0100
committerThomas Jarosch <tomj@simonv.com>2014-12-22 21:12:11 +0100
commit06eeab02422b49680a812e0120806f8628cd9c38 (patch)
tree74e56a2126f06019e2dd3948a68264201ad8579e
parent9a5f7ce0f2fd44ab5d78ae40f98fc4ab963517bf (diff)
downloadrockbox-06eeab02422b49680a812e0120806f8628cd9c38.tar.gz
rockbox-06eeab02422b49680a812e0120806f8628cd9c38.tar.bz2
rockbox-06eeab02422b49680a812e0120806f8628cd9c38.zip
Always initialize "item"
Otherwise item.cfg_name and item.default_val will contain garbage. It doesn't seem to have an effect right now, but who knows what a future refactoring might do. cppcheck reported: [rockbox/apps/settings.c:1268]: (error) Uninitialized variable: item Change-Id: Ic4d0c302929613de8f291cd2d69cd39db8711107
-rw-r--r--apps/settings.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 515e7cb5f3..4b2c1fe3db 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -1255,6 +1255,7 @@ bool set_option(const char* string, const void* variable, enum optiontype type,
function, UNIT_INT, 0, numoptions-1, 1,
set_option_formatter, set_option_get_talk_id
};
+ memset(item, 0, sizeof(struct settings_list));
set_option_options = options;
item.int_setting = &data;
item.flags = F_INT_SETTING|F_T_INT;