Commit 539e6c138ec3edc42f72a23d8e8814edf1319f07

Vicent Martí 2012-05-26T10:38:24

Merge pull request #732 from schu/fix-gcc-nonnull tests-clar/core: fix non-null warning

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/tests-clar/core/env.c b/tests-clar/core/env.c
index 3bde856..15d431f 100644
--- a/tests-clar/core/env.c
+++ b/tests-clar/core/env.c
@@ -48,8 +48,11 @@ static int cl_setenv(const char *name, const char *value)
 
 #include <stdlib.h>
 #define cl_getenv(n)   getenv(n)
-#define cl_setenv(n,v) (v) ? setenv((n),(v),1) : unsetenv(n)
 
+static int cl_setenv(const char *name, const char *value)
+{
+	return (value == NULL) ? unsetenv(name) : setenv(name, value, 1);
+}
 #endif
 
 #ifdef GIT_WIN32