diff options
Diffstat (limited to 'src/command.c')
-rw-r--r-- | src/command.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c index e3167baf..015cdb8e 100644 --- a/src/command.c +++ b/src/command.c @@ -18,12 +18,16 @@ static uint8_t next_sequence = MESSAGE_DEST; static uint32_t command_encode_ptr(void *p) { + if (sizeof(size_t) > sizeof(uint32_t)) + return p - console_receive_buffer(); return (size_t)p; } void * command_decode_ptr(uint32_t v) { + if (sizeof(size_t) > sizeof(uint32_t)) + return console_receive_buffer() + v; return (void*)(size_t)v; } |