commit: b0b2afb1941f540126aa510d47636cd8d2cf9ad8 Author: gto2023 <gto7052 <AT> mailbox <DOT> org> AuthorDate: Thu Jul 13 11:59:24 2023 +0000 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> CommitDate: Sun Aug 6 00:39:52 2023 +0000 URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=b0b2afb1
sandbox: do not compare array to NULL Fixes a compiler warning: ``` src/environ.c:211:19: warning: the comparison will always evaluate as ‘true’ for the address of ‘work_dir’ will never be NULL [-Waddress] ``` Bug: https://bugs.gentoo.org/906234 Signed-off-by: gto2023 <gto7052 <AT> mailbox.org> Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> (cherry picked from commit 7f230519475c2aaea91df75b0165d8b6c03b9fa9) src/environ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/environ.c b/src/environ.c index 542dd64..2b28c0b 100644 --- a/src/environ.c +++ b/src/environ.c @@ -208,7 +208,7 @@ static int setup_cfg_vars(struct sandbox_info_t *sandbox_info) if (-1 == setup_access_var(ENV_SANDBOX_WRITE)) return -1; if ((NULL == getenv(ENV_SANDBOX_WRITE)) && - (NULL != sandbox_info->work_dir)) + strlen(sandbox_info->work_dir)) setenv(ENV_SANDBOX_WRITE, sandbox_info->work_dir, 1); if (-1 == setup_access_var(ENV_SANDBOX_PREDICT))
