fix pointer checking order

This commit is contained in:
Ryan Pavlik
2011-09-02 16:13:16 -05:00
parent 4ad1e56cdf
commit fa8662f781

View File

@@ -628,16 +628,16 @@ WIIUSE_DEBUG("chaud2fois");
* This function is not part of the wiiuse API.
*/
void wiiuse_send_next_pending_write_request(struct wiimote_t* wm) {
struct data_req_t* req = wm->data_req;
struct data_req_t* req;
if (!wm || !WIIMOTE_IS_CONNECTED(wm))
return;
req = wm->data_req;
if (!req)
return;
if (!req->data || !req->len)
return;
if(req->state!=REQ_READY) return;
req = wm->data_req;
if (!req)
return;
wiiuse_write_data(wm, req->addr, req->data, req->len);