diff options
Diffstat (limited to 'tracker-wii/wiiyourself/wiimote.cpp')
-rw-r--r-- | tracker-wii/wiiyourself/wiimote.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tracker-wii/wiiyourself/wiimote.cpp b/tracker-wii/wiiyourself/wiimote.cpp index e1e49101..e7a8ca90 100644 --- a/tracker-wii/wiiyourself/wiimote.cpp +++ b/tracker-wii/wiiyourself/wiimote.cpp @@ -255,7 +255,9 @@ bool wiimote::Connect (unsigned wiimote_index, bool force_hidwrites) { // get the buffer size for this device detail instance DWORD req_size = 0; - SetupDiGetDeviceInterfaceDetail(dev_info, &didata, NULL, 0, &req_size, NULL); + (void)SetupDiGetDeviceInterfaceDetail(dev_info, &didata, NULL, 0, &req_size, NULL); + if (req_size < sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA)) + WARN(_T("couldn't get device size for %u"), index); // (bizarre way of doing it) create a buffer large enough to hold the // fixed-size detail struct components, and the variable string size |