summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/bin.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/shared/bin.h b/shared/bin.h
index 1eaa2a7..a849d53 100644
--- a/shared/bin.h
+++ b/shared/bin.h
@@ -17,7 +17,8 @@ extern uint8_t g_w2_endianness;
#define W2_CREATE_MSG_BIN(type, normal, bin) \
W2_CREATE_MSG_SIZE_BIN(type, sizeof(type), normal, bin)
#define W2_CREATE_MSG_SIZE_BIN(type, size, normal, bin) \
- w2_s_bin* bin = malloc(size); \
+ w2_s_bin* bin = malloc(sizeof(w2_s_bin) + size); \
+ bin->bytes = size; \
type* normal = (type*) &bin->data;
typedef struct {