Fix some crashes by checking pointers before deref
This commit is contained in:
@@ -144,6 +144,8 @@ int wiiuse_connect(struct wiimote_t** wm, int wiimotes) {
|
||||
int i = 0;
|
||||
|
||||
for (; i < wiimotes; ++i) {
|
||||
if (!wm[i])
|
||||
continue;
|
||||
if (WIIMOTE_IS_SET(wm[i], WIIMOTE_STATE_CONNECTED))
|
||||
++connected;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user