1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-19 02:52:11 +00:00

Merge pull request #41 from romanz/fsm_assert

fsm: add compile-time assert for response size validation
This commit is contained in:
Pavol Rusnak 2015-08-24 14:03:28 +02:00
commit e9e51b1377

View File

@ -51,7 +51,9 @@
static uint8_t msg_resp[MSG_OUT_SIZE];
#define RESP_INIT(TYPE) TYPE *resp = (TYPE *)msg_resp; memset(resp, 0, sizeof(TYPE));
#define RESP_INIT(TYPE) TYPE *resp = (TYPE *)msg_resp; \
_Static_assert(sizeof(msg_resp) >= sizeof(TYPE), #TYPE " is too large"); \
memset(resp, 0, sizeof(TYPE));
void fsm_sendSuccess(const char *text)
{