summaryrefslogtreecommitdiff
path: root/src/Error.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-11 18:41:14 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-11 18:51:26 -0700
commit3c54e99864eb6dba0d0cde7fe0a23ed7c1f5875f (patch)
treec00b9f2dc00e8b391052d4a8726d356b0d772e8a /src/Error.c
parentbbe78f905da6e36ebe1fe520903c760107b92b78 (diff)
Use memcpy() instead of memmove() when buffers are known not to overlap
Most of these came from a mass bcopy() -> memmove() substitution in 1993 with a commit comment of "ANSIfication". Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/Error.c')
-rw-r--r--src/Error.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Error.c b/src/Error.c
index ed5990a..93e3c9e 100644
--- a/src/Error.c
+++ b/src/Error.c
@@ -266,7 +266,7 @@ DefaultMsg(String name,
if (i > 10)
i = 10;
- (void) memmove((char *) par, (char *) params, i * sizeof(String));
+ (void) memcpy(par, params, i * sizeof(String));
memset(&par[i], 0, (10 - i) * sizeof(String));
(void) fprintf(stderr, "%s%s",
error ? XTERROR_PREFIX : XTWARNING_PREFIX,
@@ -305,7 +305,7 @@ program as a non-root user or by removing the suid bit on the executable.");
if (i > 10)
i = 10;
- (void) memmove((char *) par, (char *) params, i * sizeof(String));
+ (void) memcpy(par, params, i * sizeof(String));
memset(&par[i], 0, (10 - i) * sizeof(String));
if (i != *num_params)
XtWarning("Some arguments in following message were lost");