Index: ppapi/shared_impl/ppb_gamepad_shared.cc |
diff --git a/ppapi/shared_impl/ppb_gamepad_shared.cc b/ppapi/shared_impl/ppb_gamepad_shared.cc |
index 4f83b39956d14bf1e6e10c51adfcaf013726b1f3..c45494a00c1c2dd07b4bf9778350ddf583825c7b 100644 |
--- a/ppapi/shared_impl/ppb_gamepad_shared.cc |
+++ b/ppapi/shared_impl/ppb_gamepad_shared.cc |
@@ -20,15 +20,14 @@ void ConvertWebKitGamepadData(const WebKitGamepads& webkit_data, |
id_size_does_not_match); |
COMPILE_ASSERT(sizeof(output_pad.axes) == sizeof(webkit_pad.axes), |
axes_size_does_not_match); |
- COMPILE_ASSERT(sizeof(output_pad.buttons) == sizeof(webkit_pad.buttons), |
- buttons_size_does_not_match); |
memcpy(output_pad.id, webkit_pad.id, sizeof(output_pad.id)); |
output_pad.timestamp = webkit_pad.timestamp; |
output_pad.axes_length = webkit_pad.axes_length; |
memcpy(output_pad.axes, webkit_pad.axes, sizeof(output_pad.axes)); |
output_pad.buttons_length = webkit_pad.buttons_length; |
- memcpy( |
- output_pad.buttons, webkit_pad.buttons, sizeof(output_pad.buttons)); |
+ |
+ for (unsigned j = 0; j < webkit_pad.buttons_length; ++j) |
+ output_pad.buttons[j] = webkit_pad.buttons[j].value; |
} |
} |
} |