int ez_basic_encode_raw(const ez_blob_desc *desc, const void *p, ez_blob *blob) {
char *b = blob->eb_data;
- size_t size = blob->eb_size;
- char *be = b+size;
for (int i=0,dlen=desc->bd_length;i<dlen;i++) {
const ez_blob_desc *d = &desc[i+1];
if (s) {
size_t len = strlen(s);
+
*(uint32_t *)b = len;
- memcpy(b+4, s, len);
- b[4+len] = 0;
+ memcpy(b + 4, s, len);
b += 4 + len;
} else {
*(uint32_t *)b = ~0U;
abort();
}
}
- assert(b == be);
+ if (b != blob->eb_size + blob->eb_data)
+ abort();
return 0;
}