Skip to content

Commit e6d0448

Browse files
committed
Use array size in send/recv API
Better to pass this rather than just assume the data size
1 parent 3d1e396 commit e6d0448

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/XInput.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ int XInputGamepad::send() {
330330
if (!newData) return 0; // TX data hasn't changed
331331
#ifdef USB_XINPUT
332332
newData = false;
333-
return XInputUSB::send(tx);
333+
return XInputUSB::send(tx, sizeof(tx));
334334
#else
335335
#warning "Using debug output for XInput send()"
336336
printDebug();
@@ -346,7 +346,7 @@ int XInputGamepad::receive() {
346346

347347
// Grab packet and store it in rx array
348348
uint8_t rx[8];
349-
int bytesRecv = XInputUSB::recv(rx);
349+
int bytesRecv = XInputUSB::recv(rx, sizeof(rx));
350350

351351
const uint8_t PacketType = rx[0];
352352

0 commit comments

Comments
 (0)