diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-08-11 18:41:14 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-08-11 18:51:26 -0700 |
commit | 3c54e99864eb6dba0d0cde7fe0a23ed7c1f5875f (patch) | |
tree | c00b9f2dc00e8b391052d4a8726d356b0d772e8a /src/Initialize.c | |
parent | bbe78f905da6e36ebe1fe520903c760107b92b78 (diff) | |
download | xorg-lib-libXt-3c54e99864eb6dba0d0cde7fe0a23ed7c1f5875f.tar.gz |
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/Initialize.c')
-rw-r--r-- | src/Initialize.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Initialize.c b/src/Initialize.c index 8252d59..d400088 100644 --- a/src/Initialize.c +++ b/src/Initialize.c @@ -672,7 +672,7 @@ _MergeOptionTables(const XrmOptionDescRec *src1, __XtMalloc((Cardinal) (sizeof(XrmOptionDescRec) * (num_src1 + num_src2))); - (void) memmove(table, src1, sizeof(XrmOptionDescRec) * num_src1); + (void) memcpy(table, src1, sizeof(XrmOptionDescRec) * num_src1); if (num_src2 == 0) { *num_dst = num_src1; return; @@ -748,7 +748,7 @@ _GetResource(Display *dpy, if (Qtype == _XtQString) *(String *) value->addr = db_value.addr; else - (void) memmove(value->addr, db_value.addr, value->size); + (void) memcpy(value->addr, db_value.addr, value->size); return True; } else { @@ -788,7 +788,7 @@ _XtPreparseCommandLine(XrmOptionDescRec *urlist, targv = (_XtString *) __XtMalloc((Cardinal) (sizeof(_XtString *) * (size_t) argc)); - (void) memmove(targv, argv, sizeof(char *) * (size_t) argc); + (void) memcpy(targv, argv, sizeof(char *) * (size_t) argc); _MergeOptionTables(opTable, XtNumber(opTable), urlist, num_urs, &options, &num_options); name_list[0] = class_list[0] = XrmPermStringToQuark("."); @@ -931,7 +931,7 @@ _XtDisplayInitialize(Display *dpy, sizeof(XrmHashTable)); if (!(search_list = (XrmHashTable *) ALLOCATE_LOCAL(size))) _XtAllocError(NULL); - (void) memmove((char *) search_list, (char *) old, (size >> 1)); + (void) memcpy(search_list, old, (size >> 1)); DEALLOCATE_LOCAL(old); } |