Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/gen Use memcpy instead of memmove since no overlaps...
details: https://anonhg.NetBSD.org/src/rev/3a64c14c717a
branches: trunk
changeset: 518919:3a64c14c717a
user: enami <enami%NetBSD.org@localhost>
date: Sat Dec 08 00:30:59 2001 +0000
description:
Use memcpy instead of memmove since no overlaps here (copy from somewhere
outside of the funciton to our stack).
diffstat:
lib/libc/gen/execvp.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (39 lines):
diff -r ebe2b46026fb -r 3a64c14c717a lib/libc/gen/execvp.c
--- a/lib/libc/gen/execvp.c Fri Dec 07 23:12:33 2001 +0000
+++ b/lib/libc/gen/execvp.c Sat Dec 08 00:30:59 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: execvp.c,v 1.19 2001/09/19 01:14:51 enami Exp $ */
+/* $NetBSD: execvp.c,v 1.20 2001/12/08 00:30:59 enami Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: execvp.c,v 1.19 2001/09/19 01:14:51 enami Exp $");
+__RCSID("$NetBSD: execvp.c,v 1.20 2001/12/08 00:30:59 enami Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -118,9 +118,9 @@
(void)write(STDERR_FILENO, ": path too long\n", 16);
continue;
}
- memmove(buf, p, lp);
+ memcpy(buf, p, lp);
buf[lp] = '/';
- memmove(buf + lp + 1, name, ln);
+ memcpy(buf + lp + 1, name, ln);
buf[lp + ln + 1] = '\0';
retry: rwlock_rdlock(&__environ_lock);
@@ -139,7 +139,7 @@
goto done;
memp[0] = _PATH_BSHELL;
memp[1] = bp;
- (void)memmove(&memp[2], &argv[1], cnt * sizeof(*memp));
+ (void)memcpy(&memp[2], &argv[1], cnt * sizeof(*memp));
rwlock_rdlock(&__environ_lock);
(void)execve(_PATH_BSHELL, (char * const *)memp,
environ);
Home |
Main Index |
Thread Index |
Old Index