mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
env: Fix env_get() when returning empty string using env_get_f()
The env_get_f() function returns -1 on failure. Returning 0 means that the variable exists, and is empty string. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
c9db4c5440
commit
e8459c12fd
1 changed files with 1 additions and 1 deletions
2
env/common.c
vendored
2
env/common.c
vendored
|
@ -125,7 +125,7 @@ char *env_get(const char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* restricted capabilities before import */
|
/* restricted capabilities before import */
|
||||||
if (env_get_f(name, (char *)(gd->env_buf), sizeof(gd->env_buf)) > 0)
|
if (env_get_f(name, (char *)(gd->env_buf), sizeof(gd->env_buf)) >= 0)
|
||||||
return (char *)(gd->env_buf);
|
return (char *)(gd->env_buf);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue