From 8fb9ce1b1723190d4a993ebb1a2a7187ba03a6a9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 12 Jun 2015 23:16:42 +0200 Subject: [PATCH] (core_options.c) Cleanups --- core_options.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core_options.c b/core_options.c index 1b901569a7..08ae5fa565 100644 --- a/core_options.c +++ b/core_options.c @@ -88,8 +88,10 @@ static bool parse_variable(core_option_manager_t *opt, size_t idx, const struct retro_variable *var) { size_t i; - const char *val_start; - char *value, *desc_end, *config_val = NULL; + const char *val_start = NULL; + char *value = NULL; + char *desc_end = NULL; + char *config_val = NULL; struct core_option *option = (struct core_option*)&opt->opts[idx]; if (!option) @@ -149,9 +151,10 @@ core_option_manager_t *core_option_new(const char *conf_path, const struct retro_variable *vars) { const struct retro_variable *var; - size_t size = 0; - core_option_manager_t *opt = (core_option_manager_t*) + size_t size = 0; + core_option_manager_t *opt = (core_option_manager_t*) calloc(1, sizeof(*opt)); + if (!opt) return NULL; @@ -173,8 +176,8 @@ core_option_manager_t *core_option_new(const char *conf_path, goto error; opt->size = size; + size = 0; - size = 0; for (var = vars; var->key && var->value; size++, var++) { if (!parse_variable(opt, size, var))