summary refs log tree commit diff
path: root/posix/execl.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/execl.c')
-rw-r--r--posix/execl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/posix/execl.c b/posix/execl.c
index ad6190cf3d..13f8b393d5 100644
--- a/posix/execl.c
+++ b/posix/execl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1994, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -39,8 +39,8 @@ execl (const char *path, const char *arg, ...)
   argv[0] = arg;
 
   va_start (args, arg);
-  i = 1;
-  do
+  i = 0;
+  while (argv[i++] != NULL)
     {
       if (i == argv_max)
 	{
@@ -62,7 +62,6 @@ execl (const char *path, const char *arg, ...)
 
       argv[i] = va_arg (args, const char *);
     }
-  while (argv[i++] != NULL);
   va_end (args);
 
   return __execve (path, (char *const *) argv, __environ);