Correctly initialize values after a new device is enabled

* src/xterm.c (handle_one_xevent): Initialize new device to
zero.  (bug#57011)
This commit is contained in:
Po Lu 2022-08-06 14:50:04 +08:00
parent 564571f712
commit 28c01bd484

View file

@ -22144,6 +22144,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
dpyinfo->devices
= xrealloc (dpyinfo->devices, (sizeof *dpyinfo->devices
* ++dpyinfo->num_devices));
memset (dpyinfo->devices + dpyinfo->num_devices - 1,
0, sizeof *dpyinfo->devices);
device = &dpyinfo->devices[dpyinfo->num_devices - 1];
xi_populate_device_from_info (device, info);
}