From c430f2d7498e9c2daa515ee9aba3a95257e5e999 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 12 Oct 2014 17:11:53 +0300 Subject: [PATCH] Zero-initialize JsDevice name buffer to avoid valgrind warning --- source/input/linux/gamecontroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/input/linux/gamecontroller.cpp b/source/input/linux/gamecontroller.cpp index bf69049..d5fed3b 100644 --- a/source/input/linux/gamecontroller.cpp +++ b/source/input/linux/gamecontroller.cpp @@ -59,7 +59,7 @@ JsDevice::JsDevice(const string &fn) string JsDevice::get_name() const { - char buf[128]; + char buf[128] = { 0 }; int ret = ioctl(*handle, JSIOCGNAME(sizeof(buf)), buf); if(ret<0) throw system_error("ioctl(JSIOCGNAME)"); -- 2.45.2