about summary refs log tree commit diff
path: root/hurd
diff options
context:
space:
mode:
Diffstat (limited to 'hurd')
-rw-r--r--hurd/hurdstartup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hurd/hurdstartup.c b/hurd/hurdstartup.c
index 17a7705847..b4721d7ef7 100644
--- a/hurd/hurdstartup.c
+++ b/hurd/hurdstartup.c
@@ -136,11 +136,13 @@ _hurd_startup (void **argptr, void (*main) (int *data))
 			  sizeof (struct hurd_startup_data));
       *argcptr = argc;
       argv = (void *) (argcptr + 1);
-      __argz_extract (args, argslen, argv);
+      __argz_extract (args, argc, argv);
+      argv[argc] = 0;
 
       /* There was some environment.  */
       envp = &argv[argc + 1];
-      __argz_extract (env, envlen, envp);
+      __argz_extract (env, envc, envp);
+      envp[envc] = 0;
     }
 
   if (err || in_bootstrap == MACH_PORT_NULL)