From: Timo Sirainen Date: Mon, 10 May 2021 08:26:54 +0000 (+0300) Subject: lib: test-env-util - Make static analyzer happy X-Git-Tag: 2.3.16~168 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e786e5f40a711417b5ea3ed154873617358a0d9a;p=thirdparty%2Fdovecot%2Fcore.git lib: test-env-util - Make static analyzer happy --- diff --git a/src/lib/test-env-util.c b/src/lib/test-env-util.c index 5762bfc8c5..7a246156cd 100644 --- a/src/lib/test-env-util.c +++ b/src/lib/test-env-util.c @@ -39,10 +39,12 @@ void test_env_util(void) test_assert(getenv("b") == NULL); test_assert_strcmp(getenv("c"), "1"); test_assert(getenv("d") == NULL); - test_assert(strcmp((*env)[0], "a=1") == 0 || - strcmp((*env)[0], "c=1") == 0); - test_assert(strcmp((*env)[1], "a=1") == 0 || - strcmp((*env)[1], "c=1") == 0); + test_assert(*env != NULL && + (null_strcmp((*env)[0], "a=1") == 0 || + null_strcmp((*env)[0], "c=1") == 0)); + test_assert(*env != NULL && + (null_strcmp((*env)[1], "a=1") == 0 || + null_strcmp((*env)[1], "c=1") == 0)); /* test env_remove() */ env_remove("a");