]> git.tdb.fi Git - libs/gui.git/commitdiff
Zero-initialize JsDevice name buffer to avoid valgrind warning
authorMikko Rasa <tdb@tdb.fi>
Sun, 12 Oct 2014 14:11:53 +0000 (17:11 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 12 Oct 2014 14:11:53 +0000 (17:11 +0300)
source/input/linux/gamecontroller.cpp

index bf690494a91c76d08d71f10d2ad8a425cf56a2a8..d5fed3baba92783c7e7e347bf0fd2fced4723100 100644 (file)
@@ -59,7 +59,7 @@ JsDevice::JsDevice(const string &fn)
 
 string JsDevice::get_name() const
 {
 
 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)");
        int ret = ioctl(*handle, JSIOCGNAME(sizeof(buf)), buf);
        if(ret<0)
                throw system_error("ioctl(JSIOCGNAME)");