aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/command.c b/src/command.c
index b0c7f882..e3167baf 100644
--- a/src/command.c
+++ b/src/command.c
@@ -15,6 +15,18 @@
static uint8_t next_sequence = MESSAGE_DEST;
+static uint32_t
+command_encode_ptr(void *p)
+{
+ return (size_t)p;
+}
+
+void *
+command_decode_ptr(uint32_t v)
+{
+ return (void*)(size_t)v;
+}
+
/****************************************************************
* Binary message parsing
@@ -78,7 +90,7 @@ command_parsef(uint8_t *p, uint8_t *maxend
if (p + len > maxend)
goto error;
*args++ = len;
- *args++ = (size_t)p;
+ *args++ = command_encode_ptr(p);
p += len;
break;
}