@@ -3,7 +3,7 @@
33
44typedef struct {
55 int size;
6− uint8_t* data;
6+ uint8_t data[0];
77} Buffer;
88
99void* idris_newBuffer(int bytes) {
@@ -13,7 +13,6 @@ void* idris_newBuffer(int bytes) {
1313 }
1414
1515 buf->size = bytes;
16− buf->data = (uint8_t*)(buf+1);
1716 memset(buf->data, 0, bytes);
1817
1918 return buf;
@@ -25,7 +24,7 @@ void idris_copyBuffer(void* from, int start, int len,
2524 Buffer* bto = to;
2625
2726 if (loc >= 0 && loc+len <= bto->size) {
28− memcpy((bto->data)+loc, (bfrom->data)+start, len);
27+ memcpy(bto->data + loc, bfrom->data + start, len);
2928 }
3029}
3130