diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c index 283906910a..d9b7593b5d 100644 --- a/input/drivers_joypad/linuxraw_joypad.c +++ b/input/drivers_joypad/linuxraw_joypad.c @@ -155,7 +155,7 @@ retry: { struct inotify_event *event = (struct inotify_event*)&event_buf[0]; - event_buf[rc] = '\0'; + event_buf[rc-1] = '\0'; /* Can read multiple events in one read() call. */