diff --git a/src_features/signMessageEIP712/commands_712.c b/src_features/signMessageEIP712/commands_712.c index c1d3a56..dc29b3d 100644 --- a/src_features/signMessageEIP712/commands_712.c +++ b/src_features/signMessageEIP712/commands_712.c @@ -28,7 +28,9 @@ void handle_eip712_return_code(bool success) { } else if (apdu_response_code == APDU_RESPONSE_OK) { // somehow not set apdu_response_code = APDU_RESPONSE_ERROR_NO_INFO; } - *(uint16_t *) G_io_apdu_buffer = __builtin_bswap16(apdu_response_code); + + G_io_apdu_buffer[0] = (apdu_response_code >> 8) & 0xff; + G_io_apdu_buffer[1] = apdu_response_code & 0xff; // Send back the response, do not restart the event loop io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, 2);