sync with OpenBSD -current
This commit is contained in:
parent
deeab190c1
commit
3c98303280
10 changed files with 24 additions and 13 deletions
|
@ -611,13 +611,13 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
|
|||
}
|
||||
|
||||
if (from->button->xkb_acts) {
|
||||
if (!to->button->xkb_acts) {
|
||||
to->button->xkb_acts = calloc(1, sizeof(XkbAction));
|
||||
if (!to->button->xkb_acts)
|
||||
FatalError("[Xi] not enough memory for xkb_acts.\n");
|
||||
}
|
||||
size_t maxbuttons = max(to->button->numButtons, from->button->numButtons);
|
||||
to->button->xkb_acts = xnfreallocarray(to->button->xkb_acts,
|
||||
maxbuttons,
|
||||
sizeof(XkbAction));
|
||||
memset(to->button->xkb_acts, 0, maxbuttons * sizeof(XkbAction));
|
||||
memcpy(to->button->xkb_acts, from->button->xkb_acts,
|
||||
sizeof(XkbAction));
|
||||
from->button->numButtons * sizeof(XkbAction));
|
||||
}
|
||||
else {
|
||||
free(to->button->xkb_acts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue