1
0
Fork 0

tools: env: fix config file loading in env library

env library is broken as the config file pointer is only initialized
in main(). When running in the env library parse_config() fails:

  Cannot parse config file '(null)': Bad address

Ensure that config file pointer is always initialized.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
utp
Anatolij Gustschin 2016-04-29 22:00:11 +02:00 committed by Tom Rini
parent f9f9d2d625
commit 925c97c248
1 changed files with 3 additions and 0 deletions

3
tools/env/fw_env.c vendored
View File

@ -1325,6 +1325,9 @@ static int parse_config ()
struct stat st;
#if defined(CONFIG_FILE)
if (!common_args.config_file)
common_args.config_file = CONFIG_FILE;
/* Fills in DEVNAME(), ENVSIZE(), DEVESIZE(). Or don't. */
if (get_config(common_args.config_file)) {
fprintf(stderr, "Cannot parse config file '%s': %m\n",