Use snprintf instead of sprintf

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics/-/merge_requests/20>
This commit is contained in:
Alan Coopersmith
2024-12-04 13:47:53 -08:00
parent 2a60fb4fb4
commit ca05a6034e

View File

@@ -1040,7 +1040,8 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
int rc;
struct libevdev *evdev;
sprintf(fname, "%s/%s", DEV_INPUT_EVENT, namelist[i]->d_name);
snprintf(fname, sizeof(fname), "%s/%s",
DEV_INPUT_EVENT, namelist[i]->d_name);
SYSCALL(fd = open(fname, O_RDONLY));
if (fd < 0)
continue;