From: Mikko Rasa Date: Sun, 12 Oct 2014 14:11:53 +0000 (+0300) Subject: Zero-initialize JsDevice name buffer to avoid valgrind warning X-Git-Url: http://git.tdb.fi/?p=libs%2Fgui.git;a=commitdiff_plain;h=c430f2d7498e9c2daa515ee9aba3a95257e5e999 Zero-initialize JsDevice name buffer to avoid valgrind warning --- 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)");