dinput: Only dump the HID report data that has been read.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-10-12 09:56:22 +02:00 committed by Alexandre Julliard
parent 33578878e6
commit cb8bc378c2
1 changed files with 2 additions and 2 deletions

View File

@ -1607,14 +1607,14 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface )
if (ret && TRACE_ON(dinput)) if (ret && TRACE_ON(dinput))
{ {
TRACE( "read size %u report:\n", count ); TRACE( "read size %u report:\n", count );
for (i = 0; i < report_len;) for (i = 0; i < count;)
{ {
char buffer[256], *buf = buffer; char buffer[256], *buf = buffer;
buf += sprintf(buf, "%08x ", i); buf += sprintf(buf, "%08x ", i);
do do
{ {
buf += sprintf(buf, " %02x", (BYTE)report_buf[i] ); buf += sprintf(buf, " %02x", (BYTE)report_buf[i] );
} while (++i % 16 && i < report_len); } while (++i % 16 && i < count);
TRACE("%s\n", buffer); TRACE("%s\n", buffer);
} }
} }