Skip to content

Commit 8ddd35e

Browse files
committed
Cast short when concatenating bytes
1 parent bd804af commit 8ddd35e

File tree

1 file changed

+1
-1
lines changed
  • Packages/com.unity.inputsystem/InputSystem/Plugins/HID

1 file changed

+1
-1
lines changed

Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HIDParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ private unsafe static int ReadData(int itemSize, byte* currentPtr, byte* endPtr)
277277
return 0;
278278
var data1 = *currentPtr;
279279
var data2 = *(currentPtr + 1);
280-
return (data2 << 8) | data1;
280+
return (short)(data2 << 8) | data1;
281281
}
282282

283283
// Read int.

0 commit comments

Comments
 (0)