From a371815efdebe8efd821a4637238d4f4651059e9 Mon Sep 17 00:00:00 2001
From: twinaphex <libretro@gmail.com>
Date: Wed, 7 Jun 2017 22:47:07 +0200
Subject: [PATCH] Try to null-terminate string

---
 input/drivers_joypad/linuxraw_joypad.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c
index 893f71f2ac..283906910a 100644
--- a/input/drivers_joypad/linuxraw_joypad.c
+++ b/input/drivers_joypad/linuxraw_joypad.c
@@ -155,6 +155,8 @@ retry:
          {
             struct inotify_event *event = (struct inotify_event*)&event_buf[0];
 
+            event_buf[rc] = '\0';
+
             /* Can read multiple events in one read() call. */
 
             for (j = 0; j < rc; j += event->len + sizeof(struct inotify_event))