about summary refs log tree commit diff
path: root/src/env
diff options
context:
space:
mode:
Diffstat (limited to 'src/env')
-rw-r--r--src/env/setenv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/env/setenv.c b/src/env/setenv.c
index 03e165c8..c2c25444 100644
--- a/src/env/setenv.c
+++ b/src/env/setenv.c
@@ -9,7 +9,7 @@ int setenv(const char *var, const char *value, int overwrite)
 	char *s;
 	int l1, l2;
 
-	if (strchr(var, '=')) {
+	if (!var || !*var || strchr(var, '=')) {
 		errno = EINVAL;
 		return -1;
 	}