about 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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/posix/execl.c b/posix/execl.c
index e831f5452f..72748a456f 100644
--- a/posix/execl.c
+++ b/posix/execl.c
@@ -52,7 +52,8 @@ execl (const char *path, const char *arg, ...)
 	  if ((char *) nptr + argv_max == (char *) argv)
 	    {
 	      /* Stack grows down.  */
-	      argv = (const char **) memcpy (nptr, argv, i);
+	      argv = (const char **) memcpy (nptr, argv,
+					     i * sizeof (const char *));
 	      argv_max += i;
 	    }
 	  else
@@ -64,7 +65,8 @@ execl (const char *path, const char *arg, ...)
 	  else
 #endif
 	    /* We have a hole in the stack.  */
-	    argv = (const char **) memcpy (nptr, argv, i);
+	    argv = (const char **) memcpy (nptr, argv,
+					   i * sizeof (const char *));
 	}
 
       argv[i] = va_arg (args, const char *);