diff --git a/src/66/66-scandir.c b/src/66/66-scandir.c
index 24775505a7fe390647dd13bc3166b72347064a9b..a32355a585579bab0dc2cd0c597f12363a458b7d 100644
--- a/src/66/66-scandir.c
+++ b/src/66/66-scandir.c
@@ -48,7 +48,7 @@
 #define USR1 6
 #define USR2 7
 
-#define MAXENV 4096 
+#define MAXENV 4095 
 #define SIGSIZE 64
 
 static uid_t OWNER ;
@@ -866,7 +866,7 @@ int main(int argc, char const *const *argv, char const *const *envp)
 	stralloc envdir = STRALLOC_ZERO ;
 	stralloc signal = STRALLOC_ZERO ;
 	
-	char const *newenv[MAXENV] ;
+	char const *newenv[MAXENV+1] ;
 	char const *const *genv = NULL ;
 	
 	up = down = rescan = create = remove = 0 ;