diff options
Diffstat (limited to 'env/common.c')
-rw-r--r-- | env/common.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/env/common.c b/env/common.c index 86122582bc1..05e78d63874 100644 --- a/env/common.c +++ b/env/common.c @@ -82,6 +82,10 @@ int env_do_env_set(int flag, int argc, char *const argv[], int env_flag) } } debug("Final value for argc=%d\n", argc); + /* Exit early if we don't have an env to apply */ + if (argc < 2) + return 0; + name = argv[1]; if (strchr(name, '=')) { @@ -466,7 +470,7 @@ int env_import(const char *buf, int check, int flags) return -EIO; } -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_ENV_REDUNDANT static unsigned char env_flags; int env_check_redund(const char *buf1, int buf1_read_fail, @@ -543,7 +547,7 @@ int env_import_redund(const char *buf1, int buf1_read_fail, return env_import((char *)ep, 0, flags); } -#endif /* CONFIG_SYS_REDUNDAND_ENVIRONMENT */ +#endif /* CONFIG_ENV_REDUNDANT */ /* Export the environment and generate CRC for it. */ int env_export(env_t *env_out) @@ -560,7 +564,7 @@ int env_export(env_t *env_out) env_out->crc = crc32(0, env_out->data, ENV_SIZE); -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_ENV_REDUNDANT env_out->flags = ++env_flags; /* increase the serial */ #endif |