diff --git a/src/io_win.cpp b/src/io_win.cpp index 4f6aee0..2e7ea18 100644 --- a/src/io_win.cpp +++ b/src/io_win.cpp @@ -87,7 +87,7 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int timeout) { /* get the size of the data block required */ i = SetupDiGetDeviceInterfaceDetail(device_info, &device_data, NULL, 0, &len, NULL); - detail_data = malloc(len); + detail_data = (SP_DEVICE_INTERFACE_DETAIL_DATA_A*)malloc(len); detail_data->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); /* query the data for this device */