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
2
env/common.c
vendored
2
env/common.c
vendored
@ -125,7 +125,7 @@ char *env_get(const char *name)
|
||||
}
|
||||
|
||||
/* 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 NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user