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/Create.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/Create.c')
-rw-r--r-- | src/Create.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Create.c b/src/Create.c index 511aa39..2b7fbf2 100644 --- a/src/Create.c +++ b/src/Create.c @@ -411,7 +411,7 @@ xtCreate(String name, wsize = widget_class->core_class.widget_size; req_widget = (Widget) XtStackAlloc(wsize, widget_cache); - (void) memmove((char *) req_widget, (char *) widget, (size_t) wsize); + (void) memcpy(req_widget, (char *) widget, (size_t) wsize); CallInitialize(XtClass(widget), req_widget, widget, args, num_args); if (parent_constraint_class != NULL) { double constraint_cache[20]; @@ -420,7 +420,7 @@ xtCreate(String name, csize = parent_constraint_class->constraint_class.constraint_size; if (csize) { req_constraints = XtStackAlloc(csize, constraint_cache); - (void) memmove((char *) req_constraints, widget->core.constraints, + (void) memcpy(req_constraints, widget->core.constraints, (size_t) csize); req_widget->core.constraints = req_constraints; } @@ -782,7 +782,7 @@ _XtCreateHookObj(Screen *screen) CompileCallbacks(hookobj); wsize = hookObjectClass->core_class.widget_size; req_widget = (Widget) XtStackAlloc(wsize, widget_cache); - (void) memmove((char *) req_widget, (char *) hookobj, (size_t) wsize); + (void) memcpy(req_widget, (char *) hookobj, (size_t) wsize); CallInitialize(hookObjectClass, req_widget, hookobj, (ArgList) NULL, (Cardinal) 0); XtStackFree((XtPointer) req_widget, widget_cache); |