commit: 7f230519475c2aaea91df75b0165d8b6c03b9fa9 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: Sat Aug 5 20:07:55 2023 +0000 URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=7f230519
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> src/environ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/environ.c b/src/environ.c index 81a3e5f..df8595b 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))