From 7f230519475c2aaea91df75b0165d8b6c03b9fa9 Mon Sep 17 00:00:00 2001 From: gto2023 Date: Thu, 13 Jul 2023 13:59:24 +0200 Subject: sandbox: do not compare array to NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Mike Gilbert --- src/environ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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)) -- cgit v1.2.3-65-gdbad