summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schubert <schu@schu.io>2012-05-26 14:59:07 +0200
committerMichael Schubert <schu@schu.io>2012-05-26 14:59:07 +0200
commitdbab04594c1eb3110cc1f65b974a88437fff9bce (patch)
treec79b61965d42e5ad5b5836ebfa0117da3ca663a8
parent29ef309e2ca39f68d11c755710446ff6d396d203 (diff)
downloadlibgit2-dbab04594c1eb3110cc1f65b974a88437fff9bce.tar.gz
tests-clar/core: fix non-null warning
gcc 4.7.0 apparently doesn't see that we won't call setenv with NULL as second argument.
-rw-r--r--tests-clar/core/env.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests-clar/core/env.c b/tests-clar/core/env.c
index 3bde85649..15d431f01 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