about summary refs log tree commit diff
path: root/posix/execvp.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/execvp.c')
-rw-r--r--posix/execvp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/posix/execvp.c b/posix/execvp.c
index 26c7be99ab..2eda603c39 100644
--- a/posix/execvp.c
+++ b/posix/execvp.c
@@ -104,9 +104,9 @@ execvp (file, argv)
 	  else
 	    {
 	      /* Construct the pathname to try.  */
-	      (void) memcpy (name, path, p - path);
-	      name[p - path] = '/';
-	      (void) memcpy (&name[(p - path) + 1], file, len);
+	      char *tmp = __mempcpy (name, path, p - path);
+	      *tmp++ = '/';
+	      (void) __mempcpy (tmp, file, len);
 	    }
 
 	  /* Try to execute this name.  If it works, execv will not return.  */